1
1
mirror of https://github.com/walles/moar.git synced 2024-11-30 22:32:42 +03:00
Commit Graph

1 Commits

Author SHA1 Message Date
Johan Walles
5e847f4cd7 Improve large file reading performance by 10%
By reading the file in two passes.

The first pass just counts the lines in the file.

The second pass starts by preallocating the correct number of lines, and
then reads the file.

The whole time saving comes from not having to dynamically resize the
lines slice while reading the file.
2021-05-03 20:33:25 +02:00