Skip to content

Commit a3de583

Browse files
committed
Use SVG graphs for better control over appearance
1 parent d81427e commit a3de583

File tree

9 files changed

+397
-83
lines changed

9 files changed

+397
-83
lines changed

README.md

Lines changed: 29 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# Advent of Code [![checks-badge]][checks-link] [![docs-badge]][docs-link]
22

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.
95

106
## Features
117

@@ -57,23 +53,13 @@ Place input files in `input/yearYYYY/dayDD.txt` including leading zeroes. For ex
5753

5854
## Performance
5955

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].
6257
All 175 solutions from 2023 to 2019 and also 2016 to 2015 complete sequentially in **1.1 seconds**.
6358
Interestingly 90% of the total time is spent on just 5 solutions.
6459
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]
7763

7864
* [2023](#2023) (7 ms)
7965
* [2022](#2022) (10 ms)
@@ -86,17 +72,7 @@ pie
8672

8773
## 2023
8874

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]
10076

10177
| Day | Problem | Solution | Benchmark (μs) |
10278
| --- | --- | --- | --: |
@@ -128,15 +104,7 @@ pie
128104

129105
## 2022
130106

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]
140108

141109
| Day | Problem | Solution | Benchmark (μs) |
142110
| --- | --- | --- | --: |
@@ -168,15 +136,7 @@ pie
168136

169137
## 2021
170138

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]
180140

181141
| Day | Problem | Solution | Benchmark (μs) |
182142
| --- | --- | --- | --: |
@@ -208,14 +168,7 @@ pie
208168

209169
## 2020
210170

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]
219172

220173
| Day | Problem | Solution | Benchmark (μs) |
221174
| --- | --- | --- | --: |
@@ -247,16 +200,7 @@ pie
247200

248201
## 2019
249202

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]
260204

261205
| Day | Problem | Solution | Benchmark (μs) |
262206
| --- | --- | --- | --: |
@@ -307,14 +251,7 @@ pie
307251

308252
## 2016
309253

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]
318255

319256
| Day | Problem | Solution | Benchmark (μs) |
320257
| --- | --- | --- | --: |
@@ -346,14 +283,7 @@ pie
346283

347284
## 2015
348285

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]
357287

358288
| Day | Problem | Solution | Benchmark (μs) |
359289
| --- | --- | --- | --: |
@@ -382,3 +312,19 @@ pie
382312
| 23 | [Opening the Turing Lock](https://adventofcode.com/2015/day/23) | [Source](src/year2015/day23.rs) | 6 |
383313
| 24 | [It Hangs in the Balance](https://adventofcode.com/2015/day/24) | [Source](src/year2015/day24.rs) | 360 |
384314
| 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

docs/pie-2015.svg

Lines changed: 39 additions & 0 deletions
Loading

docs/pie-2016.svg

Lines changed: 39 additions & 0 deletions
Loading

docs/pie-2019.svg

Lines changed: 53 additions & 0 deletions
Loading

docs/pie-2020.svg

Lines changed: 39 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)