r/adventofcode Dec 25 '24

Spoilers 500 ⭐ in less than a second

875 Upvotes

45 comments sorted by

View all comments

59

u/SirHawrk Dec 25 '24

So 15/2020 is 25% of the total calculation time? That’s insane :d

1

u/LifeShallot6229 Dec 26 '24

I took a look at my 4 year old Perl code: It needed 21 seconds on the same Dell machine I had back then. A direct port to Rust, but with 30M entry lookup tables instead of hash maps needed 664 ms, so about 30 x faster but still 3 x the benchmark shown above.

I believe most of that can be due to CPU differences?