Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Apr 1995 17:33:43 -0500 (CDT)
From:      "Clay D. Hopperdietzel" <hoppy@appsmiths.com>
To:        hackers@FreeBSD.org
Subject:   Re: new install(1) utility
Message-ID:  <199504052233.RAA22470@anvil.appsmiths.com>
In-Reply-To: <199504052134.HAA31128@godzilla.zeta.org.au> from "Bruce Evans" at Apr 6, 95 07:33:44 am

next in thread | previous in thread | raw e-mail | index | archive | help
:: 
:: >> > 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!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504052233.RAA22470>