From owner-cvs-all Mon Dec 27 21:47:28 1999 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C56CC14A1A; Mon, 27 Dec 1999 21:47:25 -0800 (PST) (envelope-from hoek@FreeBSD.org) Received: (from hoek@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id VAA94745; Mon, 27 Dec 1999 21:47:25 -0800 (PST) (envelope-from hoek@FreeBSD.org) Message-Id: <199912280547.VAA94745@freefall.freebsd.org> From: Tim Vanderhoek Date: Mon, 27 Dec 1999 21:47:25 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/more ch.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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