Something like accumulating to three separate SSE registers per iteration and then combining them outside the loop.
Something like accumulating to three separate SSE registers per iteration and then combining them outside the loop.
But I'd wager it's probably limited by the SSD speed and filesystem caching code at this point.
(Would be easy enough for an assembly guru to prove either of us right or wrong!)
The same code on memory instead of a file gives me around 14GB/s. Maximum I can achieve with threads and/or intrinsics is 18GB/s (theoretical maximum for my dual channel memory is 20GB/s). This is pretty much a memory bounded problem.
I assume the author was using an older gcc version (as mentioned, autovectorization is not really a solved problem), and a lot of time in this scenario is going into file I/O:
real 0m0.126s user 0m0.071s sys 0m0.056s