Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Blazing fast Rust solutions for every Advent of Code puzzle from 2015 to 2025, solving 524 stars in less than 1 second.

License

NotificationsYou must be signed in to change notification settings

maneatingape/advent-of-code-rust

Repository files navigation

Blazing fast Rust solutions for everyAdvent of Code puzzle from 2015 to 2025, taking472 milliseconds to solve all 524 stars. Each solution is carefully optimized for performancewhile ensuring the code remains concise, readable, and idiomatic.

Features

  • Minimal - Depends only on the standard library.
  • High Quality - Formatted withrustfmt, linted byclippy and continuously testedviaGitHub Actions. Nounsafe code.
  • Well Documented - Every solution is comprehensively commented withrustdoc-generated documentation also available online.

Quickstart

Show details

Input

Place input files ininput/yearYYYY/dayDD.txt including leading zeroes. For example:

  • input/year2015/day23.txt
  • input/year2023/day02.txt

Run

  • Everythingcargo run
  • Specific yearcargo run year2023
  • Specific daycargo run year2023::day01
  • Release profile (faster)cargo run --release
  • Optimized for current CPU architecture (fastest)RUSTFLAGS="-C target-cpu=native" cargo run --release

Test

  • Everythingcargo test
  • Specific yearcargo test year2023
  • Specific daycargo test year2023::day01
  • Show STDOUT for debuggingcargo test -- --nocapture

Benchmark

  • Everythingcargo bench
  • Specific yearcargo bench year2023
  • Specific daycargo bench year2023::day01

Document

  • Build docs including private itemscargo doc --document-private-items
  • Build docs then open HTML landing pagecargo doc --document-private-items --open

Miscellaneous

  • Code quality lintscargo clippy
  • Consistent code formattingcargo fmt

Contributing

Improvements to solutions are always appreciated. Please see thedetailed instructions on how to get started.

Performance

Benchmarks are measured using the built-incargo bench tool run on anApple 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 anIntel i7-2720QM processor takes 3.5 seconds to run the same 262 solutions.

pie-all

Year2025
Benchmark (ms)2
Year2015201620172018201920202021202220232024
Benchmark (ms)141095735132208554

2025

pie-2025

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

2024

pie-2024

DayProblemSolutionBenchmark (μs)
1Historian HysteriaSource21
2Red-Nosed ReportsSource40
3Mull It OverSource8
4Ceres SearchSource77
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 DeviceSource11
8Treetop Tree HouseSource51
9Rope BridgeSource107
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!Source12
3Binary DiagnosticSource22
4Giant SquidSource8
5Hydrothermal VentureSource158
6LanternfishSource1
7The Treachery of WhalesSource8
8Seven Segment SearchSource14
9Smoke BasinSource64
10Syntax ScoringSource14
11Dumbo OctopusSource55
12Passage PathingSource25
13Transparent OrigamiSource22
14Extended PolymerizationSource11
15ChitonSource2403
16Packet DecoderSource6
17Trick ShotSource7
18SnailfishSource476
19Beacon ScannerSource615
20Trench MapSource511
21Dirac DiceSource278
22Reactor RebootSource378
23AmphipodSource1714
24Arithmetic Logic UnitSource4
25Sea CucumberSource551

2020

pie-2020

DayProblemSolutionBenchmark (μs)
1Report RepairSource12
2Password PhilosophySource35
3Toboggan TrajectorySource8
4Passport ProcessingSource38
5Binary BoardingSource11
6Custom CustomsSource35
7Handy HaversacksSource58
8Handheld HaltingSource8
9Encoding ErrorSource9
10Adapter ArraySource1
11Seating SystemSource831
12Rain RiskSource12
13Shuttle SearchSource1
14Docking DataSource83
15Rambunctious RecitationSource103000
16Ticket TranslationSource120
17Conway CubesSource102
18Operation OrderSource24
19Monster MessagesSource362
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 StationSource404
11Space PoliceSource320
12The N-Body ProblemSource838
13Care PackageSource2527
14Space StoichiometrySource17
15Oxygen SystemSource291
16Flawed Frequency TransmissionSource224
17Set and ForgetSource338
18Many-Worlds InterpretationSource1039
19Tractor BeamSource688
20Donut MazeSource189
21Springdroid AdventureSource1785
22Slam ShuffleSource12
23Category SixSource670
24Planet of DiscordSource232
25CryostasisSource2047

2018

pie-2018

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

2017

pie-2017

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

2016

pie-2016

DayProblemSolutionBenchmark (μs)
1No Time for a TaxicabSource3
2Bathroom SecuritySource29
3Squares With Three SidesSource24
4Security Through ObscuritySource79
5How About a Nice Game of Chess?Source33000
6Signals and NoiseSource3
7Internet Protocol Version 7Source364
8Two-Factor AuthenticationSource9
9Explosives in CyberspaceSource7
10Balance BotsSource16
11Radioisotope Thermoelectric GeneratorsSource719
12Leonardo's MonorailSource1
13A Maze of Twisty Little CubiclesSource3
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 ComputingSource28
23Safe CrackingSource1
24Air Duct SpelunkingSource316
25Clock SignalSource1

2015

pie-2015

DayProblemSolutionBenchmark (μs)
1Not Quite LispSource2
2I Was Told There Would Be No MathSource8
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 RequiredSource27
8MatchsticksSource5
9All in a Single NightSource34
10Elves Look, Elves SaySource17
11Corporate PolicySource1
12JSAbacusFramework.ioSource71
13Knights of the Dinner TableSource37
14Reindeer OlympicsSource24
15Science for Hungry PeopleSource43
16Aunt SueSource20
17No Such Thing as Too MuchSource45
18Like a GIF For Your YardSource154
19Medicine for RudolphSource23
20Infinite Elves and Infinite HousesSource368
21RPG Simulator 20XXSource2
22Wizard Simulator 20XXSource235
23Opening the Turing LockSource6
24It Hangs in the BalanceSource237
25Let It SnowSource1

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp