There seems to be a pathological case with one of the files I'm reading with less.
The file is ~300MB in size, disk is fast (local NMVE) and the file can comfortably fit in memory, there is no swapping or anything like that.
less --version gives me
less 563 (PCRE regular expressions)
on Arch Linux. I run with no commandline parameters (no -R or -S).
The file I am reading is being written to.
Usage:
I notice using follow (pressing F) is generally slow for this file, but workable.
Things are made worse by having a search active (for highlighting) while follow is in progress.
Now if I search for the following: (something|something-else).*|.*warn and then hit F (follow), it totally grinds to a halt. I need to kill it from a different terminal.
I've been using such regexes with much larger files with no issue. Could something be amiss?
Edit: more exact steps and info:
- happens with 50MB file, no long lines
- another process appends to the file every 15s
Steps:
- I open the file, go to end (Shift+g)
- search for
(something|something-else).*|.*warn(saysPattern not foundsince at the end) - follow (Shift+f) -> CPU goes to 100% and seemingly never stops
- instead of pressing Shift+f, the same happens if I press UpArrow following the search
- if I reduce the regex to one of its parts (either
(something|something-else).*or.*warnthe operations take a few seconds, still slow but manageable - resident memory shows as 400MB in htop
- Ctrl+C doesn't work to interrupt it, need to kill from outside