1
1
mirror of https://github.com/walles/moar.git synced 2024-11-30 02:34:13 +03:00
moar/m
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
..
ansiTokenizer_test.go Lower memory usage by 10% 2021-05-02 19:28:51 +02:00
ansiTokenizer.go Lower memory usage by 10% 2021-05-02 19:28:51 +02:00
embed-api.go Lower memory usage by 10% 2021-05-02 19:28:51 +02:00
highlight.go Don't highlight files larger than 1MB 2021-04-24 16:14:30 +02:00
matchRanges_test.go Make a lot fewer functions public 2020-12-29 22:57:44 +01:00
matchRanges.go Make a lot fewer functions public 2020-12-29 22:57:44 +01:00
pager_test.go Don't highlight files larger than 1MB 2021-04-24 16:14:30 +02:00
pager.go Log trace events on user input 2021-04-29 23:04:12 +02:00
reader_test.go Improve large file reading performance by 10% 2021-05-03 20:33:25 +02:00
reader.go Improve large file reading performance by 10% 2021-05-03 20:33:25 +02:00