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 by clippy and continuously tested via GitHub Actions. No unsafe code.
  • 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.txt
  • input/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.

pie-all

Year2025
Benchmark (ms)2
Year2024202320222021202020192018201720162015
Benchmark (ms)555822013335610713

2025

pie-2025

DayProblemSolutionBenchmark (μs)
1Secret EntranceSource24
2Gift ShopSource1
3LobbySource21
4Printing DepartmentSource177
5CafeteriaSource20
6Trash CompactorSource20
7LaboratoriesSource5
8PlaygroundSource441
9Movie TheaterSource40
10FactorySource194
11ReactorSource59
12Christmas Tree FarmSource25

2024

pie-2024

DayProblemSolutionBenchmark (μs)
1Historian HysteriaSource21
2Red-Nosed ReportsSource40
3Mull It OverSource8
4Ceres SearchSource74
5Print QueueSource18
6Guard GallivantSource405
7Bridge RepairSource136
8Resonant CollinearitySource8
9Disk FragmenterSource106
10Hoof ItSource38
11Plutonian PebblesSource227
12Garden GroupsSource289
13Claw ContraptionSource14
14Restroom RedoubtSource74
15Warehouse WoesSource303
16Reindeer MazeSource350
17Chronospatial ComputerSource2
18RAM RunSource42
19Linen LayoutSource110
20Race ConditionSource1113
21Keypad ConundrumSource19
22Monkey MarketSource688
23LAN PartySource43
24Crossed WiresSource23
25Code ChronicleSource8

2023

pie-2023

DayProblemSolutionBenchmark (μs)
1Trebuchet?!Source37
2Cube ConundrumSource9
3Gear RatiosSource53
4ScratchcardsSource20
5If You Give A Seed A FertilizerSource18
6Wait For ItSource1
7Camel CardsSource71
8Haunted WastelandSource34
9Mirage MaintenanceSource18
10Pipe MazeSource35
11Cosmic ExpansionSource12
12Hot SpringsSource455
13Point of IncidenceSource66
14Parabolic Reflector DishSource632
15Lens LibrarySource84
16The Floor Will Be LavaSource160
17Clumsy CrucibleSource2379
18Lavaduct LagoonSource11
19AplentySource100
20Pulse PropagationSource6
21Step CounterSource182
22Sand SlabsSource40
23A Long WalkSource68
24Never Tell Me The OddsSource95
25SnowverloadSource179

2022

pie-2022

DayProblemSolutionBenchmark (μs)
1Calorie CountingSource14
2Rock Paper ScissorsSource3
3Rucksack ReorganizationSource13
4Camp CleanupSource8
5Supply StacksSource13
6Tuning TroubleSource3
7No Space Left On DeviceSource10
8Treetop Tree HouseSource51
9Rope BridgeSource99
10Cathode-Ray TubeSource2
11Monkey in the MiddleSource244
12Hill Climbing AlgorithmSource57
13Distress SignalSource15
14Regolith ReservoirSource146
15Beacon Exclusion ZoneSource2
16Proboscidea VolcaniumSource59
17Pyroclastic FlowSource71
18Boiling BouldersSource52
19Not Enough MineralsSource74
20Grove Positioning SystemSource2685
21Monkey MathSource64
22Monkey MapSource61
23Unstable DiffusionSource1061
24Blizzard BasinSource62
25Full of Hot AirSource3

2021

pie-2021

DayProblemSolutionBenchmark (μs)
1Sonar SweepSource6
2Dive!Source1
3Binary DiagnosticSource8
4Giant SquidSource8
5Hydrothermal VentureSource136
6LanternfishSource1
7The Treachery of WhalesSource4
8Seven Segment SearchSource14
9Smoke BasinSource33
10Syntax ScoringSource14
11Dumbo OctopusSource55
12Passage PathingSource25
13Transparent OrigamiSource12
14Extended PolymerizationSource11
15ChitonSource2290
16Packet DecoderSource6
17Trick ShotSource3
18SnailfishSource440
19Beacon ScannerSource378
20Trench MapSource511
21Dirac DiceSource337
22Reactor RebootSource378
23AmphipodSource1714
24Arithmetic Logic UnitSource4
25Sea CucumberSource551

2020

pie-2020

DayProblemSolutionBenchmark (μs)
1Report RepairSource1
2Password PhilosophySource35
3Toboggan TrajectorySource8
4Passport ProcessingSource33
5Binary BoardingSource11
6Custom CustomsSource8
7Handy HaversacksSource58
8Handheld HaltingSource7
9Encoding ErrorSource9
10Adapter ArraySource1
11Seating SystemSource831
12Rain RiskSource4
13Shuttle SearchSource1
14Docking DataSource83
15Rambunctious RecitationSource103000
16Ticket TranslationSource104
17Conway CubesSource102
18Operation OrderSource24
19Monster MessagesSource462
20Jurassic JigsawSource42
21Allergen AssessmentSource45
22Crab CombatSource5333
23Crab CupsSource109000
24Lobby LayoutSource330
25Combo BreakerSource20

2019

pie-2019

DayProblemSolutionBenchmark (μs)
1The Tyranny of the Rocket EquationSource1
21202 Program AlarmSource1
3Crossed WiresSource17
4Secure ContainerSource7
5Sunny with a Chance of AsteroidsSource3
6Universal Orbit MapSource29
7Amplification CircuitSource79
8Space Image FormatSource4
9Sensor BoostSource1008
10Monitoring StationSource342
11Space PoliceSource320
12The N-Body ProblemSource838
13Care PackageSource2527
14Space StoichiometrySource17
15Oxygen SystemSource291
16Flawed Frequency TransmissionSource224
17Set and ForgetSource215
18Many-Worlds InterpretationSource1039
19Tractor BeamSource216
20Donut MazeSource189
21Springdroid AdventureSource1360
22Slam ShuffleSource12
23Category SixSource670
24Planet of DiscordSource232
25CryostasisSource1196

2018

pie-2018

DayProblemSolutionBenchmark (μs)
1Chronal CalibrationSource11
2Inventory Management SystemSource48
3No Matter How You Slice ItSource55
4Repose RecordSource46
5Alchemical ReductionSource390
6Chronal CoordinatesSource41
7The Sum of Its PartsSource2
8Memory ManeuverSource23
9Marble ManiaSource909
10The Stars AlignSource11
11Chronal ChargeSource542
12Subterranean SustainabilitySource22
13Mine Cart MadnessSource349
14Chocolate ChartsSource24000
15Beverage BanditsSource563
16Chronal ClassificationSource37
17Reservoir ResearchSource118
18Settlers of The North PoleSource384
19Go With The FlowSource1
20A Regular MapSource24
21Chronal ConversionSource66
22Mode MazeSource1994
23Experimental Emergency TeleportationSource44
24Immune System Simulator 20XXSource1943
25Four-Dimensional AdventureSource97

2017

pie-2017

DayProblemSolutionBenchmark (μs)
1Inverse CaptchaSource1
2Corruption ChecksumSource2
3Spiral MemorySource2
4High-Entropy PassphrasesSource86
5A Maze of Twisty Trampolines, All AlikeSource18000
6Memory ReallocationSource79
7Recursive CircusSource93
8I Heard You Like RegistersSource35
9Stream ProcessingSource23
10Knot HashSource66
11Hex EdSource13
12Digital PlumberSource59
13Packet ScannersSource1
14Disk DefragmentationSource488
15Dueling GeneratorsSource20000
16Permutation PromenadeSource68
17SpinlockSource23
18DuetSource7
19A Series of TubesSource19
20Particle SwarmSource245
21Fractal ArtSource5
22Sporifica VirusSource16000
23Coprocessor ConflagrationSource11
24Electromagnetic MoatSource275
25The Halting ProblemSource1672

2016

pie-2016

DayProblemSolutionBenchmark (μs)
1No Time for a TaxicabSource2
2Bathroom SecuritySource9
3Squares With Three SidesSource26
4Security Through ObscuritySource67
5How About a Nice Game of Chess?Source33000
6Signals and NoiseSource3
7Internet Protocol Version 7Source364
8Two-Factor AuthenticationSource9
9Explosives in CyberspaceSource7
10Balance BotsSource14
11Radioisotope Thermoelectric GeneratorsSource2
12Leonardo's MonorailSource1
13A Maze of Twisty Little CubiclesSource2
14One-Time PadSource71000
15Timing is EverythingSource1
16Dragon ChecksumSource1
17Two Steps ForwardSource3606
18Like a RogueSource400
19An Elephant Named JosephSource1
20Firewall RulesSource21
21Scrambled Letters and HashSource10
22Grid ComputingSource20
23Safe CrackingSource1
24Air Duct SpelunkingSource117
25Clock SignalSource1

2015

pie-2015

DayProblemSolutionBenchmark (μs)
1Not Quite LispSource2
2I Was Told There Would Be No MathSource6
3Perfectly Spherical Houses in a VacuumSource95
4The Ideal Stocking StufferSource12000
5Doesn't He Have Intern-Elves For This?Source38
6Probably a Fire HazardSource454
7Some Assembly RequiredSource8
8MatchsticksSource5
9All in a Single NightSource7
10Elves Look, Elves SaySource17
11Corporate PolicySource1
12JSAbacusFramework.ioSource71
13Knights of the Dinner TableSource10
14Reindeer OlympicsSource21
15Science for Hungry PeopleSource43
16Aunt SueSource20
17No Such Thing as Too MuchSource4
18Like a GIF For Your YardSource47
19Medicine for RudolphSource23
20Infinite Elves and Infinite HousesSource1
21RPG Simulator 20XXSource2
22Wizard Simulator 20XXSource150
23Opening the Turing LockSource6
24It Hangs in the BalanceSource23
25Let It SnowSource1