Date: Mon, 27 Dec 1999 21:47:25 -0800 (PST) From: Tim Vanderhoek <hoek@FreeBSD.org> To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/more ch.c Message-ID: <199912280547.VAA94745@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
hoek 1999/12/27 21:47:25 PST
Modified files:
usr.bin/more ch.c
Log:
Rather than use an LRU-ordered circular list to store buffered data,
simply keep an index into the last access on the circular list and begin
searches at that point. An LRU list is inappropriate here since the
vast majority of accesses will occur in the same order that the list
is created in. The only case where an LRU is remotely useful here is when
reading from a file and the user is jumping to randomish positions and
constantly returning to some central position. Even for this case it is
such a small optimization as not to be noticed in an interactive program
such as more(1).
This change results in a _tremendously_ noticable speed-up when reading long
files through a pipe (where long = ~200k, machine = ~2.5h single-disk
worldstone).
Revision Changes Path
1.8 +65 -35 src/usr.bin/more/ch.c
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912280547.VAA94745>
