]> localhost Git - adventofcode2024.git/log
adventofcode2024.git
3 months agoImprove day 6 performance
Jack Kinsey [Sat, 7 Dec 2024 05:48:30 +0000 (00:48 -0500)]
Improve day 6 performance

I profiled with `cargo flamegraph` and learned that the HashMap
operations were taking forever. So, I replaced the HashMap with a
straight Vec*, which bought a 10x improvement. Further profiling revealed
complaints with re-finding the guard starting position in every single
blocked-walk, so I added a way to provide the position to the
constructor (since it never changes). This brought the total speedup to
15x, from ~1.5s on the release build to ~0.1s.

*The memory usage (valgrind, valgrind --tool=massif, valgrind
--tool=dhat) between the two data structures seems comparable. I guess
if the walks were significantly sparser on the map the HashMap might
win, but apparently they aren't, so we end up using basically as much
memory in the HashMap anyway.

3 months agoComplete day 6
Jack Kinsey [Sat, 7 Dec 2024 04:07:34 +0000 (23:07 -0500)]
Complete day 6

Though this solution is correct, it's still apparently quite
inefficient--the debug build takes ~20 seconds to run, and the release
build takes ~1.5 seconds. Considering every other problem combined runs
in less than 0.03 seconds on the release build, this is very bad.

3 months agoComplete day 5
Jack Kinsey [Fri, 6 Dec 2024 03:44:37 +0000 (22:44 -0500)]
Complete day 5

3 months agoAdd support for running every day
Jack Kinsey [Thu, 5 Dec 2024 03:55:11 +0000 (22:55 -0500)]
Add support for running every day

3 months agoTidy up day 4
Jack Kinsey [Thu, 5 Dec 2024 03:48:05 +0000 (22:48 -0500)]
Tidy up day 4

3 months agoComplete day 4
Jack Kinsey [Thu, 5 Dec 2024 02:29:39 +0000 (21:29 -0500)]
Complete day 4

3 months agoComplete day 3
Jack Kinsey [Wed, 4 Dec 2024 04:51:48 +0000 (23:51 -0500)]
Complete day 3

3 months agoImprove problem infra
Jack Kinsey [Wed, 4 Dec 2024 03:40:45 +0000 (22:40 -0500)]
Improve problem infra

3 months agoComplete day 2
Jack Kinsey [Tue, 3 Dec 2024 07:01:58 +0000 (02:01 -0500)]
Complete day 2

4 months agoComplete day 1
Jack Kinsey [Tue, 3 Dec 2024 07:01:50 +0000 (02:01 -0500)]
Complete day 1

4 months agoInitial commit
Jack Kinsey [Tue, 3 Dec 2024 07:01:04 +0000 (02:01 -0500)]
Initial commit