I want to read all lines of a 1 GB large file as fast as possible into a Stream
. Currently I\'m using Files(path).lines()
for that. A
You might find some help from this post. Trying to parallelize the actual reading of a file is probably barking up the wrong tree, as the biggest slowdown will be your file system (even on an SSD).
If you set up a file channel in memory, you should be able to process the data in parallel from there with great speed, but chances are you won't need it as you'll see a huge speed increase.