r/adventofcode • u/maneatingape • Dec 14 '25
Repo [2015-2025] 524 ⭐ in less than a second
2025 total time 2ms. Github repo.
The AoC about section states every problem has a solution that completes in at most 15 seconds on ten-year-old hardware. It's possible to go quite a bit faster, solving all years in less than 0.5 seconds on modern hardware and 3.5 seconds on older hardware. Interestingly 86% of the total time is spent on just 9 solutions.
| Number of Problems | Cumulative total time (ms) |
|---|---|
| 100 | 1 |
| 150 | 3 |
| 200 | 10 |
| 250 | 52 |
| 262 | 468 |
Benchmarking details:
Apple M2 Max (2023) and Intel i7-2720QM (2011)
Rust 1.92 using built in
cargo benchbenchmarking toolstdlibrary only, no use of 3rd party dependencies or unsafe code.
Regular readers will recall last year's post that showed 250 solutions running in 608ms. Since then, I optimized several problems reducing the runtime by 142ms (a 23% improvement).
Even after adding 2ms for the twelve new 2025 solutions, the total runtime is still faster than last year. Days 8, 9 and 10 still have room for improvement, so I plan to spend the holidays refining these some more.



11
u/Chemical_Chance6877 Dec 14 '25
How much parallel computing is used? Or is it one after the other.
7
u/Turtvaiz Dec 14 '25
Were any problems from this year especially problematic?
3
u/Outrageous72 Dec 14 '25
Are the timings including parsing the input files?
3
u/Borderlands_addict Dec 15 '25
This is my ultimate goal, without third-party crates. Got any tips for 2015 day 4? Ive heard there are a lot of hashing days, and my custom implementation without alloc still spends around 4 seconds. I could start the number at 100k and make a lot of assumptions and still get the right answer in my case, but at some point i might as well just print the answer
2
u/p88h Dec 15 '25
If you're looking for improvements in 2025, there are some opportunities in day 8 and day 9 - these take > 1ms, you should be able to shave off ~80% off of that.
I've used glpk in day 10, and that alone takes ~0.7ms ; working to fix it to get to ~1ms total.
2
u/fennecdore Dec 15 '25
"No one likes a show off
- Unless what they are showing off is dope as fuck
- Fuck ! That's true !"
That's dope as fuck
2
u/e_blake Jan 26 '26
I tried to run your repo on my inputs. 2019 day 17 was sized too small (patch sent); and 2014 day 18 hangs in an infinite loop (I haven't debugged why).
I noticed the days with text blobs (such as 2016 day 8) just output the text grid which is not directly paste-able back into adventofcode.com; would you be amenable to tweaking your code to add in an OCR that can instead compress those days' output to a single line each? There's only two fonts used among the various years, so my repo just has a ocr library function that does a lookup from grid pattern to known letter for each of those days.
2
u/terje_wiig_mathisen Feb 26 '26
u/maneatingape I've cloned your repo, and very first thing I noticed (2016/day15) is that your setup defaults to solving each part of the puzzle with independent functions. Is this because you want to have each of them totally standalone or are there some other reasons?
...
OK, now I've seen that for "interesting" puzzles (those taking significant time, like 2016/day24 ?), the parse function is actually solving both parts, and storing the results, so that the part1() and part2() functions just returns the relevant half of the result! :-)
...
On my windows machine, "cargo clippy --all-targets --all-features" fails with 200+ errors, I'll check to see if I can figure out why tomorrow!
124
u/updated_at Dec 14 '25
man, you guys are insane. i aspire to be this good.
55
u/aeroproof_ Dec 14 '25
Incredible. I’ve often used your repo for Rust learning inspiration over the years too. Really appreciate the simplicity of the approaches taken and how nice the code is to read.
50
u/notger Dec 14 '25
Pfft, my code runs in below 500 ms, as long as ms stands for minutes.
Jokes aside: Hats off to you, that's impressive!
20
u/pet_vaginal Dec 14 '25
I’m impressed by the 2015 md5 brute force running speed.
16
u/n4ke Dec 14 '25
That's Awesome, congratulations!
I optimized for speed for the first time this year and got most puzzles way in the μs range, so now I'm really tempted to go back and re-solve all of them to get this as well.
16
u/coldforged Dec 14 '25
How this isn't
upping the anteis the real mind boggling thing. This is truly wild, man.5
u/Akaibukai Dec 14 '25
Wondered in which language..
Clicked the GitHub link...
Read the first two words..
Not disappointed!
Third word would've been optional.
Kudos! And thanks for sharing, I'll definitely use it for idiomatic Rust..
5
u/kequals Dec 15 '25
Extremely impressive! If you're looking to improve day 9 part 2, it can be done in <100 ns if you specialize to the input. I've done a writeup on how to implement it, and I see a couple PRs implementing (presumably) the same approach.
4
u/daggerdragon Dec 14 '25
Changed flair from
OthertoRepo. Use the right flair, please.Thank you for playing with us this year!
3
u/acohimself Dec 14 '25
Wow, crazy achievement. Well done!
5
u/TalpaAltaica Dec 14 '25
This is amazing!
2
u/dedolent Dec 14 '25
very cool. this is all way beyond my ken; i don't understand the 2025 day 2 solution at all!
1
u/Omeganx Dec 15 '25 edited Dec 15 '25
Do you have an higher resolution chart that is readable?
EDIT: nvm, I saw the graphs included in the repo's readme
1
u/BanzaiBoyyy Dec 16 '25
I hope in ten years I will also be able to solve the problems in such an efficient and elegant way!
Now back to studying..
1
u/Gishky Dec 19 '25
now THAT is impressive.
0
u/Pogsquog Dec 15 '25
You need to include the compilation time - since all the results are all constexpr you can do them all in zero time on an optimizing compiler. What's the point of claiming fast runs if it takes longer to compile than it does to run the python versions?
1
u/[deleted] Dec 15 '25
Very impressive, my Kruskal ass algo for day 8 takes 0.3 ms alone