[lkml]   [1996]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: trashing caused by less
Date wrote:
> Hi !
> I played around a bit with the pager less, and found that 50%
> increase in file size gives a horrible increase (x400) in execution time.

Less does two things that affect this:

1) by default, on startup, it scans the entire file for newline chars,
so that it can display line numbers at the bottom of the screen.
There is a flag to turn this off.

2) whenever less reads from a pipe, it caches what it read into less's
own internal buffer system, which grows as needed. If you happen to
be on the verge of swapping, then this will dramatically slow down less
since it's own internal buffers will cause more system swapping.
It also does this buffering for files, but in that case it limits the
number of buffers it uses, since it knows it can re-read the data
if necessary.

There are a couple of flags you can use to tweak this. See the manpage.

 \ /
  Last update: 2005-03-22 13:36    [W:0.065 / U:0.016 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site