Advent of Code [![checks-badge]][checks-link] [![docs-badge]][docs-link]
July 29, 2026 · View on GitHub
Blazing fast Rust solutions for every Advent of Code puzzle from 2015 to 2025, taking 467 milliseconds to solve all 524 stars. Each solution is carefully optimized for performance while ensuring the code remains concise, readable, and idiomatic.
Features
- Minimal - Depends only on the standard library.
- High Quality - Formatted with
rustfmt, linted byclippyand continuously tested via GitHub Actions. Nounsafecode. - Well Documented - Every solution is comprehensively commented with rustdoc-generated documentation also available online.
Quickstart
Show details
Input
Place input files in input/yearYYYY/dayDD.txt including leading zeroes. For example:
input/year2015/day23.txtinput/year2023/day02.txt
Run
- Everything
cargo run - Specific year
cargo run year2023 - Specific day
cargo run year2023::day01 - Release profile (faster)
cargo run --release - Enable SIMD feature
cargo run --features simd - Optimized for current CPU architecture (fastest)
RUSTFLAGS="-C target-cpu=native" cargo run --release
Test
- Everything
cargo test - Specific year
cargo test year2023 - Specific day
cargo test year2023::day01 - Show STDOUT for debugging
cargo test -- --nocapture
Benchmark
- Everything
cargo bench - Specific year
cargo bench year2023 - Specific day
cargo bench year2023::day01
Linting and Formatting
- Clippy lints
cargo clippy --all-targets --all-features - Consistent code formatting
cargo fmt -- `find . -name "*.rs"`
Document
- Build docs including private items
cargo doc --document-private-items - Build docs then open HTML landing page
cargo doc --document-private-items --open
Contributing
Improvements to solutions are always appreciated. Please see the detailed instructions on how to get started.
Performance
Benchmarks are measured using the built-in cargo bench tool run on an Apple M2 Max.
Interestingly, 86% of the total time is spent on just 9 solutions.
Performance is reasonable even on older hardware, for example a 2011 MacBook Pro with an
Intel i7-2720QM processor takes 3.5 seconds to run the same 262 solutions.
| Year | 2025 |
|---|---|
| Benchmark (ms) | 2 |
| Year | 2024 | 2023 | 2022 | 2021 | 2020 | 2019 | 2018 | 2017 | 2016 | 2015 |
|---|---|---|---|---|---|---|---|---|---|---|
| Benchmark (ms) | 5 | 5 | 5 | 8 | 220 | 13 | 33 | 56 | 107 | 13 |
2025
| Day | Problem | Solution | Benchmark (μs) |
|---|---|---|---|
| 1 | Secret Entrance | Source | 24 |
| 2 | Gift Shop | Source | 1 |
| 3 | Lobby | Source | 21 |
| 4 | Printing Department | Source | 177 |
| 5 | Cafeteria | Source | 20 |
| 6 | Trash Compactor | Source | 20 |
| 7 | Laboratories | Source | 5 |
| 8 | Playground | Source | 441 |
| 9 | Movie Theater | Source | 40 |
| 10 | Factory | Source | 194 |
| 11 | Reactor | Source | 59 |
| 12 | Christmas Tree Farm | Source | 25 |
2024
| Day | Problem | Solution | Benchmark (μs) |
|---|---|---|---|
| 1 | Historian Hysteria | Source | 21 |
| 2 | Red-Nosed Reports | Source | 40 |
| 3 | Mull It Over | Source | 8 |
| 4 | Ceres Search | Source | 74 |
| 5 | Print Queue | Source | 18 |
| 6 | Guard Gallivant | Source | 405 |
| 7 | Bridge Repair | Source | 136 |
| 8 | Resonant Collinearity | Source | 8 |
| 9 | Disk Fragmenter | Source | 106 |
| 10 | Hoof It | Source | 38 |
| 11 | Plutonian Pebbles | Source | 227 |
| 12 | Garden Groups | Source | 289 |
| 13 | Claw Contraption | Source | 14 |
| 14 | Restroom Redoubt | Source | 74 |
| 15 | Warehouse Woes | Source | 303 |
| 16 | Reindeer Maze | Source | 350 |
| 17 | Chronospatial Computer | Source | 2 |
| 18 | RAM Run | Source | 42 |
| 19 | Linen Layout | Source | 110 |
| 20 | Race Condition | Source | 1113 |
| 21 | Keypad Conundrum | Source | 19 |
| 22 | Monkey Market | Source | 688 |
| 23 | LAN Party | Source | 43 |
| 24 | Crossed Wires | Source | 23 |
| 25 | Code Chronicle | Source | 8 |
2023
2022
2021
| Day | Problem | Solution | Benchmark (μs) |
|---|---|---|---|
| 1 | Sonar Sweep | Source | 6 |
| 2 | Dive! | Source | 1 |
| 3 | Binary Diagnostic | Source | 8 |
| 4 | Giant Squid | Source | 8 |
| 5 | Hydrothermal Venture | Source | 136 |
| 6 | Lanternfish | Source | 1 |
| 7 | The Treachery of Whales | Source | 4 |
| 8 | Seven Segment Search | Source | 14 |
| 9 | Smoke Basin | Source | 33 |
| 10 | Syntax Scoring | Source | 14 |
| 11 | Dumbo Octopus | Source | 55 |
| 12 | Passage Pathing | Source | 25 |
| 13 | Transparent Origami | Source | 12 |
| 14 | Extended Polymerization | Source | 11 |
| 15 | Chiton | Source | 2290 |
| 16 | Packet Decoder | Source | 6 |
| 17 | Trick Shot | Source | 3 |
| 18 | Snailfish | Source | 440 |
| 19 | Beacon Scanner | Source | 378 |
| 20 | Trench Map | Source | 511 |
| 21 | Dirac Dice | Source | 337 |
| 22 | Reactor Reboot | Source | 378 |
| 23 | Amphipod | Source | 1714 |
| 24 | Arithmetic Logic Unit | Source | 4 |
| 25 | Sea Cucumber | Source | 551 |
2020
| Day | Problem | Solution | Benchmark (μs) |
|---|---|---|---|
| 1 | Report Repair | Source | 1 |
| 2 | Password Philosophy | Source | 35 |
| 3 | Toboggan Trajectory | Source | 8 |
| 4 | Passport Processing | Source | 33 |
| 5 | Binary Boarding | Source | 11 |
| 6 | Custom Customs | Source | 8 |
| 7 | Handy Haversacks | Source | 58 |
| 8 | Handheld Halting | Source | 7 |
| 9 | Encoding Error | Source | 9 |
| 10 | Adapter Array | Source | 1 |
| 11 | Seating System | Source | 831 |
| 12 | Rain Risk | Source | 4 |
| 13 | Shuttle Search | Source | 1 |
| 14 | Docking Data | Source | 83 |
| 15 | Rambunctious Recitation | Source | 103000 |
| 16 | Ticket Translation | Source | 104 |
| 17 | Conway Cubes | Source | 102 |
| 18 | Operation Order | Source | 24 |
| 19 | Monster Messages | Source | 462 |
| 20 | Jurassic Jigsaw | Source | 42 |
| 21 | Allergen Assessment | Source | 45 |
| 22 | Crab Combat | Source | 5333 |
| 23 | Crab Cups | Source | 109000 |
| 24 | Lobby Layout | Source | 330 |
| 25 | Combo Breaker | Source | 20 |