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 and 2016 to 2015 entries for the annual [ Advent of Code] ( https://adventofcode.com/ ) challenge, written in performant Rust.
8
+ Complete 2023 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
@@ -29,21 +29,21 @@ Place input files in `input/yearYYYY/dayDD.txt` including leading zeroes. For ex
29
29
30
30
** Run**
31
31
* Everything ` cargo run `
32
- * Specific year ` cargo run year2022 `
33
- * Specific day ` cargo run year2022 ::day01 `
32
+ * Specific year ` cargo run year2023 `
33
+ * Specific day ` cargo run year2023 ::day01 `
34
34
* Release profile (faster) ` cargo run --release `
35
35
* Optimized for current CPU architecture (fastest) ` RUSTFLAGS="-C target-cpu=native" cargo run --release `
36
36
37
37
** Test**
38
38
* Everything ` cargo test `
39
- * Specific year ` cargo test year2022 `
40
- * Specific day ` cargo test year2022 ::day01 `
39
+ * Specific year ` cargo test year2023 `
40
+ * Specific day ` cargo test year2023 ::day01 `
41
41
* Show STDOUT for debugging ` cargo test -- --nocapture `
42
42
43
43
** Benchmark**
44
44
* Everything ` cargo bench `
45
- * Specific year ` cargo bench year2022 `
46
- * Specific day ` cargo bench year2022 ::day01 `
45
+ * Specific year ` cargo bench year2023 `
46
+ * Specific day ` cargo bench year2023 ::day01 `
47
47
48
48
** Document**
49
49
* Build docs including private items ` cargo doc --document-private-items `
@@ -57,12 +57,13 @@ Place input files in `input/yearYYYY/dayDD.txt` including leading zeroes. For ex
57
57
58
58
## Performance
59
59
60
- Benchmarks are measured using the built-in ` cargo bench ` tool run on an Apple M2 Max.
61
- All 150 solutions from 2022 to 2019 and also 2016 to 2015 complete sequentially in ** 1.1 seconds** .
62
- Interestingly 93% of the total time is spent on just 6 solutions.
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 ) .
62
+ All 175 solutions from 2023 to 2019 and also 2016 to 2015 complete sequentially in ** 1.1 seconds** .
63
+ Interestingly 90% of the total time is spent on just 5 solutions.
63
64
Performance is reasonable even on older hardware, for example a 2011 MacBook Pro with an
64
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 )
65
- processor takes 4.4 seconds to run the same 150 solutions.
66
+ processor takes 4.1 seconds to run the same 175 solutions.
66
67
67
68
``` mermaid
68
69
%%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#e4c4fb", "pie6": "#c6cdd5"}}}%%
71
72
"Year 2016" : 663
72
73
"Year 2020" : 286
73
74
"Year 2015" : 87
74
- "Years 2019, 2021 and 2022 " : 42
75
+ "Years 2019, 2021, 2022 and 2023 " : 52
75
76
```
76
77
77
- * [ 2023] ( #2023 ) (in progress )
78
+ * [ 2023] ( #2023 ) (10 ms )
78
79
* [ 2022] ( #2022 ) (10 ms)
79
80
* [ 2021] ( #2021 ) (10 ms)
80
81
* [ 2020] ( #2020 ) (286 ms)
85
86
86
87
## 2023
87
88
89
+ ``` mermaid
90
+ %%{init: {"themeVariables": { "pie1": "#7cb5ec", "pie2": "#90ed7d", "pie3": "#f7a35c", "pie4": "#e4d354", "pie5": "#c6cdd5"}}}%%
91
+ pie
92
+ title Year 2023 benchmark time by % of total
93
+ "Day 23" : 3181
94
+ "Day 17" : 2463
95
+ "Day 12" : 1150
96
+ "Day 16" : 831
97
+ "Others" : 2206
98
+ ```
99
+
88
100
| Day | Problem | Solution | Benchmark (μs) |
89
101
| --- | --- | --- | --: |
90
102
| 1 | [ Trebuchet?!] ( https://adventofcode.com/2023/day/1 ) | [ Source] ( src/year2023/day01.rs ) | 35 |
0 commit comments