4 ms·
There's a Rust solution posted in the Reddit Day 1 answers mega thread which claims 22 microseconds part 1 and 10 microseconds part 2. (I haven't tried to verif
by jodrellblank 2y ago
There's a Rust solution posted in the Reddit Day 1 answers mega thread which claims 22 microseconds part 1 and 10 microseconds part 2. (I haven't tried to verify):
https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzv90g1/ https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...
- surajrmal 2y agoSure but how long did it take to compile
- jodrellblank 2y agoI 'git clone' and 'cargo run' and it downloaded 16 crates and compiled all the crates and built a debug version in 29.7 seconds. Then 'cargo build --release' took 23.3 seconds. Commenting out one of the sort_unstable lines and rebuilding gave me a warning, recompiled in 1.8 seconds.
- jodrellblank 2y agoCan't edit my comment, here's another claiming 12.7 μs and 7 μs: https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzykfxp/ https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_... Another claiming 30μs and 32μs: https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_day_1_solutions/lzydegd/ https://old.reddit.com/r/adventofcode/comments/1h3vp6n/2024_...
- dzaima 2y agoFor an interesting comparison, here's BQN, an array language, at 25.5μs (on an i3-4160) for both parts, including input parsing: https://github.com/dzaima/aoc/blob/master/2024/BQN/1_fast.bqn https://github.com/dzaima/aoc/blob/master/2024/BQN/1_fast.bq...
- jodrellblank 2y agoThat's very impressive.