From owner-cvs-usrsbin Tue Jan 10 22:37:59 1995 Return-Path: cvs-usrsbin-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id WAA19459 for cvs-usrsbin-outgoing; Tue, 10 Jan 1995 22:37:59 -0800 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id WAA19453; Tue, 10 Jan 1995 22:37:56 -0800 Received: (from phk@localhost) by ref.tfs.com (8.6.8/8.6.6) id WAA26340; Tue, 10 Jan 1995 22:37:31 -0800 From: Poul-Henning Kamp Message-Id: <199501110637.WAA26340@ref.tfs.com> Subject: Re: cvs commit: src/usr.sbin/kvm_mkdb kvm_mkdb.c nlist.c To: bde@zeta.org.au (Bruce Evans) Date: Tue, 10 Jan 1995 22:37:30 -0800 (PST) Cc: CVS-commiters@freefall.cdrom.com, cvs-usrsbin@freefall.cdrom.com, phk@freefall.cdrom.com In-Reply-To: <199501102142.IAA25273@godzilla.zeta.org.au> from "Bruce Evans" at Jan 11, 95 08:42:53 am Content-Type: text Content-Length: 1035 Sender: cvs-usrsbin-owner@FreeBSD.org Precedence: bulk > > Modified: usr.sbin/kvm_mkdb kvm_mkdb.c nlist.c > > Log: > > Speed kvm_mkdb up by a factor 5 or thereabout. Rewrote all the fseek/fread > > nonsense to use a mmap'ed file instead and told the DB/hash what we are up to. > > > > dev_mkdb could maybe benefit from the same treatment. > > I speeded it up by a factor of 10 or thereabouts by removing write-through > of full blocks in ufs. (kvm, and potentially anything that does a lot of > random access, writes to the same blocks many times.) Your fix works > because there is no way to tell when an mmap'ed block is full, so the > write-through pessimization cannot be applied. Nice try Bruce :-) I thought so too. The real speedup came because I changed the defaults to the dbopen call to have a intelligent pagesize and a decent cachesize. I only realized this after having done all the mmap changes, so I left them in. -- Poul-Henning Kamp TRW Financial Systems, Inc. FreeBSD has, until now, not one single time had an undetected error. :-)