Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Well, I think I mostly got it. But what I couldn't figure out was which updates to skip, so maybe it can get a bit faster still. Time on the M1 Mac Mini was 4.3 ms for combined user+system, see below. That system time being as long as the user time is maybe from the massive heap allocation and init to zero at program start? I also tried to do it dynamically with malloc, without block initialisation, but that was a tiny bit slower, so I left it as a static array. Pi 400: 98 ms, old Macbook from 2013: 36 ms (both same deal: user time = system time). Code: https://github.com/ednl/aoc2018/blob/main/day09alt.c
When I get back home after the holiday weekend I'll try benchmarking on my machine properly. But here's my version (in Common Lisp): https://github.com/rabuf/advent-of-code/blob/master/2018/2018.09.org