r/adventofcode • u/daggerdragon • Dec 04 '15
SOLUTION MEGATHREAD --- Day 4 Solutions ---
--- Day 4: The Ideal Stocking Stuffer ---
Post your solution as a comment. Structure your post like the Day Three thread.
14
Upvotes
View all comments
Show parent comment
3
u/[deleted] Dec 04 '15 edited Dec 12 '15
Rust
I actually decided to go and try to thread it anyways, i never threaded anything so i have no idea just how silly the way i went about it, so any feed back would be great. (also new to rust)
It went from being about -50% to -10% slower because i was using locks in a silly way, to about 25% to 50% faster at >= 2 threads when i fixed a few things about how i was managing locks, then realized i could implement some kinda buffer to let threads spend time not waiting on the lock, it became at less 400% faster (8 cores AMD cpu) on even the first challenge, second solution running in 0.8 seconds.