From owner-freebsd-hackers Wed Apr 5 15:34:11 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA03444 for hackers-outgoing; Wed, 5 Apr 1995 15:34:11 -0700 Received: from anvil.appsmiths.com (anvil.appsmiths.com [198.65.131.65]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id PAA03439 for ; Wed, 5 Apr 1995 15:34:07 -0700 Received: (from hoppy@localhost) by anvil.appsmiths.com (8.6.8/8.6.6) id RAA22470 for hackers@freebsd.org; Wed, 5 Apr 1995 17:33:44 -0500 From: "Clay D. Hopperdietzel" Message-Id: <199504052233.RAA22470@anvil.appsmiths.com> Subject: Re: new install(1) utility To: hackers@FreeBSD.org Date: Wed, 5 Apr 1995 17:33:43 -0500 (CDT) In-Reply-To: <199504052134.HAA31128@godzilla.zeta.org.au> from "Bruce Evans" at Apr 6, 95 07:33:44 am X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1326 Sender: hackers-owner@FreeBSD.org Precedence: bulk :: :: >> > obvious if they don't match, and doing cksums on both files would be :: >> > much faster than the 'cmp' IMHO. :: >> :: >> Funny you should mention, I just ran some experiments (for CTM), and the :: >> fastest thing you can do is to mmap both files and memcmp them... :: :: There are many reasons why checksumming might be slower, especially if it :: isn't implemented carefully. Checksumming can only be faster if you can :: usually avoid reading the target. A non-hashed database in a single file :: would be very slow. You would have to use a hashed database. Writing :: the database would add a lot of overhead. This would be more of a :: problem for install than for ctm since files are unfortunately often :: installed one at a time so the database would have to be opened and :: closed a lot. Not to mention the fact that the memcmp() is going to bail at the first difference...probably avoiding most of the I/O to begin with. =============================================================================== Clay D. Hopperdietzel hoppy@appsmiths.com AppSmiths, Inc. Voice (713) 578-0154 Fax (713) 578-6182 15915 Katy Fwy, Suite 470 Where do *I* Want to Go Today? Houston, Texas 77094 FreeBSD!