|
5 | 5 | [docs-badge]: https://img.shields.io/github/actions/workflow/status/maneatingape/advent-of-code-rust/docs.yml?color=blue&label=docs
|
6 | 6 | [docs-link]: https://maneatingape.github.io/advent-of-code-rust/aoc/
|
7 | 7 |
|
8 |
| -Complete 2022 to 2019 entries for the annual [Advent of Code](https://adventofcode.com/) challenge, written in performant Rust. |
| 8 | +Complete 2022 to 2019 and 2016 to 2015 entries for the annual [Advent of Code](https://adventofcode.com/) challenge, written in performant Rust. |
9 | 9 |
|
10 | 10 | ## Features
|
11 | 11 |
|
@@ -52,34 +52,33 @@ Complete 2022 to 2019 entries for the annual [Advent of Code](https://adventofco
|
52 | 52 | ## Performance
|
53 | 53 |
|
54 | 54 | Benchmarks are measured using the built-in `cargo bench` tool run on an Apple M2 Max.
|
55 |
| -All 125 solutions from 2022 to 2019 and also 2015 complete sequentially in **422 milliseconds**. |
56 |
| -Interestingly 82% of the total time is spent on just 3 solutions. |
| 55 | +All 150 solutions from 2022 to 2019 and also 2016 to 2015 complete sequentially in **1085 milliseconds**. |
| 56 | +Interestingly 93% of the total time is spent on just 6 solutions. |
57 | 57 | Performance is reasonable even on older hardware, for example a 2011 MacBook Pro with an
|
58 | 58 | [Intel i7-2720QM](https://ark.intel.com/content/www/us/en/ark/products/50067/intel-core-i72720qm-processor-6m-cache-up-to-3-30-ghz.html)
|
59 | 59 | processor takes 83 milliseconds to run the 50 solutions from 2022 to 2021.
|
60 | 60 |
|
61 | 61 | ```mermaid
|
62 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#f7a35c', 'pie4': '#e4d354', 'pie5': '#e4c4fb'}}}%% |
| 62 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#e4c4fb", "pie6": "#c6cdd5"}}}%% |
63 | 63 | pie
|
64 | 64 | title Each year benchmark time by % of total
|
| 65 | + "Year 2016" : 664 |
65 | 66 | "Year 2020" : 286
|
66 | 67 | "Year 2015" : 85
|
67 |
| - "Year 2019" : 21 |
68 |
| - "Year 2022" : 19 |
69 |
| - "Year 2021" : 11 |
| 68 | + "Years 2019, 2021 and 2022" : 51 |
70 | 69 | ```
|
71 | 70 |
|
72 | 71 | * [2022](#2022) (19 ms)
|
73 | 72 | * [2021](#2021) (11 ms)
|
74 | 73 | * [2020](#2020) (286 ms)
|
75 | 74 | * [2019](#2019) (21 ms)
|
76 |
| -* [2016](#2016) (in progress) |
| 75 | +* [2016](#2016) (663 ms) |
77 | 76 | * [2015](#2015) (85 ms)
|
78 | 77 |
|
79 | 78 | ## 2022
|
80 | 79 |
|
81 | 80 | ```mermaid
|
82 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#f7a35c', 'pie4': '#e4d354', 'pie5': '#e4c4fb', 'pie6': '#c6cdd5'}}}%% |
| 81 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#e4c4fb", "pie6": "#c6cdd5"}}}%% |
83 | 82 | pie
|
84 | 83 | title Year 2022 benchmark time by % of total
|
85 | 84 | "Day 20" : 7449
|
|
121 | 120 | ## 2021
|
122 | 121 |
|
123 | 122 | ```mermaid
|
124 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#f7a35c', 'pie4': '#e4d354', 'pie5': '#c6cdd5'}}}%% |
| 123 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#c6cdd5"}}}%% |
125 | 124 | pie
|
126 | 125 | title Year 2021 benchmark time by % of total
|
127 | 126 | "Day 15" : 2567
|
|
162 | 161 | ## 2020
|
163 | 162 |
|
164 | 163 | ```mermaid
|
165 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#c6cdd5'}}}%% |
| 164 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
166 | 165 | pie
|
167 | 166 | title Year 2020 benchmark time by % of total
|
168 | 167 | "Day 15" : 160000
|
|
201 | 200 | ## 2019
|
202 | 201 |
|
203 | 202 | ```mermaid
|
204 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#f7a35c', 'pie4': '#e4d354', 'pie5': '#c6cdd5'}}}%% |
| 203 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#c6cdd5"}}}%% |
205 | 204 | pie
|
206 | 205 | title Year 2019 benchmark time by % of total
|
207 | 206 | "Day 16" : 4124
|
|
241 | 240 |
|
242 | 241 | ## 2016
|
243 | 242 |
|
| 243 | +```mermaid |
| 244 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
| 245 | +pie |
| 246 | + title Year 2016 benchmark time by % of total |
| 247 | + "Day 14" : 434000 |
| 248 | + "Day 5" : 212000 |
| 249 | + "Others" : 16696 |
| 250 | +``` |
| 251 | + |
244 | 252 | | Day | Problem | Solution | Benchmark (μs) |
|
245 | 253 | | --- | --- | --- | --: |
|
246 | 254 | | 1 | [No Time for a Taxicab](https://adventofcode.com/2016/day/1) | [Source](src/year2016/day01.rs) | 3 |
|
|
272 | 280 | ## 2015
|
273 | 281 |
|
274 | 282 | ```mermaid
|
275 |
| -%%{init: {'theme': 'base', 'themeVariables': { 'pie1': '#7cb5ec', 'pie2': '#90ed7d', 'pie3': '#c6cdd5'}}}%% |
| 283 | +%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
276 | 284 | pie
|
277 | 285 | title Year 2015 benchmark time by % of total
|
278 | 286 | "Day 4" : 76000
|
|
0 commit comments