Go to file
Parnic 1ff595a6cd Dramatically improve day 17 runtime
This takes the time from 20s+ to 90ms. There were 2 slow places, both LINQ shortcuts I was taking to simplify a few problems. Keeping track of the current tower height can be done without finding the highest Y out of the entire tower repeatedly per rock, which was a big chunk of slowness, and finding cycles can be done without chunking things up and comparing every single chunk, which was the other part of the slowness (I can be reasonably sure that if 3 chunks in a row match, we probably found the cycle, at least with the sample input and my input).

Then a tiny amount of tuning the data to my input set (skipping 300 since it finds the loop starting at offset 309) and changing an unrolled multiplication loop into a plain multiply cleans up the last few bits.
2022-12-18 12:20:16 -06:00
2022-12-18 11:11:37 -06:00
2022-11-30 17:19:53 -06:00
2022-12-18 12:20:16 -06:00
2022-11-30 17:19:53 -06:00
2022-12-18 11:11:37 -06:00
2022-12-01 23:14:58 -06:00
2022-11-30 17:19:53 -06:00

Advent of Code 2022

My solutions to Advent of Code 2022.

Description
No description provided
Readme 301 KiB
Languages
C# 100%