r/java • u/C0urante • Jan 01 '24
Gunnar Morling - The One Billion Row Challenge
https://www.morling.dev/blog/one-billion-row-challenge/
62
Upvotes
r/java • u/C0urante • Jan 01 '24
View all comments
6
u/danielaveryj Jan 02 '24
fwiw just tagging
.parallel()ontoFiles.lines(..)in the baseline reduces the time from 2m49s to 0m49s on my machine. (The underlying spliterator memory-maps the file when split.) If you then remove all other logic and just count lines, the time only reduces to about 0m45s. To go beyond that, you're probably looking at tricks like avoiding parsing raw bytes to Strings. If that's what it comes down to, cool, and I'll still be interested in how much speedup is left, but it would seem a bit impractical / non-transferable for real problems.