Even more interesting would be small ram, little local storage and a large file only available via network, I would like to see something other than http but realistically it would be http.
(Of course, the five times in a row might mess with that.)
Parallelism with edge effects is pretty common. Weather simulation, finite element analysis, and big-world games all have that issue. The middle of each cell is local, but you have to talk to the neighbor cells a little.
Code: https://github.com/rockwotj/1brc
Discussion on Filesystem cache: https://x.com/rockwotj/status/1742168024776430041?s=20
In case you haven't noticed yet, the input format guarantees exactly one fractional digit, so you can read a single signed integer followed by `.` and one digit instead.
edit: doh that works for min and max but the average overflows.
(The easiest I can think of is submitting reads for "overlapped" chunks, I'm not sure there is an easier way and I'm not sure of how much performance overhead there is to it.)
That's what I used to think, too. But the kernel ain't that smart.
I thought memory mapping solved a different problem.