5 ms·
Not for string search, but I got fed up with the extremely long time it takes less to precalculate line counts on large files when I was working with log files
by nhaehnle 12y ago
Not for string search, but I got fed up with the extremely long time it takes less to precalculate line counts on large files when I was working with log files of a size in the order of GBs. The result is here: https://github.com/nhaehnle/less https://github.com/nhaehnle/less
Since it was only a small hack to scratch the itch I was having at the time, I never really completed that project. For example, backwards line counting is not sped up, which can sometimes be noticeable.
If you feel like working on less-speedup issues, feel free to drop me a line.
- jingo 12y ago"... I got fed up with the extremely long time it takes less to precalculate line counts on large files..." When you were experiencing long wait times, did you turn off line numbering? less -n logfile
- sounds 12y agoYou can also turn off line numbering _during_ the long "calculating line numbers" phase. Hit Ctrl-C and it says "line numbering off" or somesuch.
- nhaehnle 12y agoSure, but that's not an option if you actually want the line numbers. Given that it was possible to speed up the line number calculation by more than an order of magnitude, I do believe that fixing the code was the right way to go :)