|
1 | 1 | # Advent of Code [![checks-badge]][checks-link] [![docs-badge]][docs-link]
|
2 | 2 |
|
3 |
| -[checks-badge]: https://img.shields.io/github/actions/workflow/status/maneatingape/advent-of-code-rust/checks.yml?label=checks |
4 |
| -[checks-link]: https://github.com/maneatingape/advent-of-code-rust/actions/workflows/checks.yml |
5 |
| -[docs-badge]: https://img.shields.io/github/actions/workflow/status/maneatingape/advent-of-code-rust/docs.yml?color=blue&label=docs |
6 |
| -[docs-link]: https://maneatingape.github.io/advent-of-code-rust/aoc/ |
7 |
| - |
8 |
| -Complete 2023 to 2019 and 2016 to 2015 entries for the annual [Advent of Code](https://adventofcode.com/) challenge, written in performant Rust. |
| 3 | +Complete 2023 to 2019 and 2016 to 2015 entries for the annual [Advent of Code] challenge, |
| 4 | +written in performant Rust. |
9 | 5 |
|
10 | 6 | ## Features
|
11 | 7 |
|
@@ -57,23 +53,13 @@ Place input files in `input/yearYYYY/dayDD.txt` including leading zeroes. For ex
|
57 | 53 |
|
58 | 54 | ## Performance
|
59 | 55 |
|
60 |
| -Benchmarks are measured using the built-in `cargo bench` tool run on an |
61 |
| -[Apple M2 Max](https://en.wikipedia.org/wiki/Apple_M2). |
| 56 | +Benchmarks are measured using the built-in `cargo bench` tool run on an [Apple M2 Max][apple-link]. |
62 | 57 | All 175 solutions from 2023 to 2019 and also 2016 to 2015 complete sequentially in **1.1 seconds**.
|
63 | 58 | Interestingly 90% of the total time is spent on just 5 solutions.
|
64 | 59 | Performance is reasonable even on older hardware, for example a 2011 MacBook Pro with an
|
65 |
| -[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) |
66 |
| -processor takes 4.1 seconds to run the same 175 solutions. |
67 |
| - |
68 |
| -```mermaid |
69 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#e4c4fb", "pie6": "#c6cdd5"}}}%% |
70 |
| -pie |
71 |
| - title Each year benchmark time by % of total |
72 |
| - "Year 2016" : 663 |
73 |
| - "Year 2020" : 286 |
74 |
| - "Year 2015" : 87 |
75 |
| - "Years 2019, 2021, 2022 and 2023" : 49 |
76 |
| -``` |
| 60 | +[Intel i7-2720QM][intel-link] processor takes 4.1 seconds to run the same 175 solutions. |
| 61 | + |
| 62 | +![pie-all] |
77 | 63 |
|
78 | 64 | * [2023](#2023) (7 ms)
|
79 | 65 | * [2022](#2022) (10 ms)
|
|
86 | 72 |
|
87 | 73 | ## 2023
|
88 | 74 |
|
89 |
| -```mermaid |
90 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#e4c4fb", "pie6": "#c6cdd5"}}}%% |
91 |
| -pie |
92 |
| - title Year 2023 benchmark time by % of total |
93 |
| - "Day 17" : 2463 |
94 |
| - "Day 16" : 831 |
95 |
| - "Day 14" : 661 |
96 |
| - "Day 23" : 632 |
97 |
| - "Day 12" : 514 |
98 |
| - "Others" : 1106 |
99 |
| -``` |
| 75 | +![pie-2023] |
100 | 76 |
|
101 | 77 | | Day | Problem | Solution | Benchmark (μs) |
|
102 | 78 | | --- | --- | --- | --: |
|
|
128 | 104 |
|
129 | 105 | ## 2022
|
130 | 106 |
|
131 |
| -```mermaid |
132 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#c6cdd5"}}}%% |
133 |
| -pie |
134 |
| - title Year 2022 benchmark time by % of total |
135 |
| - "Day 20" : 5067 |
136 |
| - "Day 23" : 2017 |
137 |
| - "Day 11" : 1172 |
138 |
| - "Others" : 1145 |
139 |
| -``` |
| 107 | +![pie-2022] |
140 | 108 |
|
141 | 109 | | Day | Problem | Solution | Benchmark (μs) |
|
142 | 110 | | --- | --- | --- | --: |
|
|
168 | 136 |
|
169 | 137 | ## 2021
|
170 | 138 |
|
171 |
| -```mermaid |
172 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#c6cdd5"}}}%% |
173 |
| -pie |
174 |
| - title Year 2021 benchmark time by % of total |
175 |
| - "Day 15" : 2567 |
176 |
| - "Day 20" : 2075 |
177 |
| - "Day 23" : 1717 |
178 |
| - "Others" : 2832 |
179 |
| -``` |
| 139 | +![pie-2021] |
180 | 140 |
|
181 | 141 | | Day | Problem | Solution | Benchmark (μs) |
|
182 | 142 | | --- | --- | --- | --: |
|
|
208 | 168 |
|
209 | 169 | ## 2020
|
210 | 170 |
|
211 |
| -```mermaid |
212 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
213 |
| -pie |
214 |
| - title Year 2020 benchmark time by % of total |
215 |
| - "Day 15" : 160000 |
216 |
| - "Day 23" : 110000 |
217 |
| - "Others" : 16671 |
218 |
| -``` |
| 171 | +![pie-2020] |
219 | 172 |
|
220 | 173 | | Day | Problem | Solution | Benchmark (μs) |
|
221 | 174 | | --- | --- | --- | --: |
|
|
247 | 200 |
|
248 | 201 | ## 2019
|
249 | 202 |
|
250 |
| -```mermaid |
251 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#c6cdd5"}}}%% |
252 |
| -pie |
253 |
| - title Year 2019 benchmark time by % of total |
254 |
| - "Day 16" : 4124 |
255 |
| - "Day 13" : 3492 |
256 |
| - "Day 25" : 2721 |
257 |
| - "Day 21" : 2265 |
258 |
| - "Others" : 10445 |
259 |
| -``` |
| 203 | +![pie-2019] |
260 | 204 |
|
261 | 205 | | Day | Problem | Solution | Benchmark (μs) |
|
262 | 206 | | --- | --- | --- | --: |
|
|
307 | 251 |
|
308 | 252 | ## 2016
|
309 | 253 |
|
310 |
| -```mermaid |
311 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
312 |
| -pie |
313 |
| - title Year 2016 benchmark time by % of total |
314 |
| - "Day 14" : 434000 |
315 |
| - "Day 5" : 212000 |
316 |
| - "Others" : 16696 |
317 |
| -``` |
| 254 | +![pie-2016] |
318 | 255 |
|
319 | 256 | | Day | Problem | Solution | Benchmark (μs) |
|
320 | 257 | | --- | --- | --- | --: |
|
|
346 | 283 |
|
347 | 284 | ## 2015
|
348 | 285 |
|
349 |
| -```mermaid |
350 |
| -%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#c6cdd5"}}}%% |
351 |
| -pie |
352 |
| - title Year 2015 benchmark time by % of total |
353 |
| - "Day 4" : 76000 |
354 |
| - "Day 6" : 5780 |
355 |
| - "Others" : 3037 |
356 |
| -``` |
| 286 | +![pie-2015] |
357 | 287 |
|
358 | 288 | | Day | Problem | Solution | Benchmark (μs) |
|
359 | 289 | | --- | --- | --- | --: |
|
|
382 | 312 | | 23 | [Opening the Turing Lock](https://adventofcode.com/2015/day/23) | [Source](src/year2015/day23.rs) | 6 |
|
383 | 313 | | 24 | [It Hangs in the Balance](https://adventofcode.com/2015/day/24) | [Source](src/year2015/day24.rs) | 360 |
|
384 | 314 | | 25 | [Let It Snow](https://adventofcode.com/2015/day/25) | [Source](src/year2015/day25.rs) | 1 |
|
| 315 | + |
| 316 | +[checks-badge]: https://img.shields.io/github/actions/workflow/status/maneatingape/advent-of-code-rust/checks.yml?label=checks |
| 317 | +[checks-link]: https://github.com/maneatingape/advent-of-code-rust/actions/workflows/checks.yml |
| 318 | +[docs-badge]: https://img.shields.io/github/actions/workflow/status/maneatingape/advent-of-code-rust/docs.yml?color=blue&label=docs |
| 319 | +[docs-link]: https://maneatingape.github.io/advent-of-code-rust/aoc/ |
| 320 | +[Advent of Code]: https://adventofcode.com |
| 321 | +[apple-link]: https://en.wikipedia.org/wiki/Apple_M2 |
| 322 | +[intel-link]: https://ark.intel.com/content/www/us/en/ark/products/50067/intel-core-i72720qm-processor-6m-cache-up-to-3-30-ghz.html |
| 323 | +[pie-all]: docs/pie-all.svg |
| 324 | +[pie-2023]: docs/pie-2023.svg |
| 325 | +[pie-2022]: docs/pie-2022.svg |
| 326 | +[pie-2021]: docs/pie-2021.svg |
| 327 | +[pie-2020]: docs/pie-2020.svg |
| 328 | +[pie-2019]: docs/pie-2019.svg |
| 329 | +[pie-2016]: docs/pie-2016.svg |
| 330 | +[pie-2015]: docs/pie-2015.svg |
0 commit comments