more(1) and less(1) are slow very with very long lines (1MB)

"H. Hartzer" <[email protected]>
Newsgroups gmane.os.openbsd.bugs
Message-ID <[email protected]>
Hi bugs@,

I tested this on 7.8.

I was using less to explore a log file and found it completely
unresponsive around certain sections of the log file. It turned out that
the log file included a 1MB line -- an image encoded in base64.

What's curious is that vi is considerably faster at moving around in the
same file. Both more and less appear to be the same speed at this.

As far as ports go, nvim also handles it well.

I'm not sure exactly why it's so slow. It may or may not be worth
addressing, but it would be nice. Especially since vi is so much faster.

Reproducing:

Write a long line: perl -e 'print "a" x 10 x 2**20;' > file
(I tried 2**30, but perl was very slow when I did that.)

less file, press end. Try to scroll back up.
more file, press end. Try to scroll back up.

Thanks!

-Henrich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.