From owner-freebsd-hackers Tue Apr 4 21:33:08 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id VAA02308 for hackers-outgoing; Tue, 4 Apr 1995 21:33:08 -0700 Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id VAA02302 for ; Tue, 4 Apr 1995 21:33:07 -0700 Received: (from phk@localhost) by ref.tfs.com (8.6.8/8.6.6) id VAA06504; Tue, 4 Apr 1995 21:32:37 -0700 From: Poul-Henning Kamp Message-Id: <199504050432.VAA06504@ref.tfs.com> Subject: Re: new install(1) utility To: nate@sneezy.sri.com Date: Tue, 4 Apr 1995 21:32:37 -0700 (PDT) Cc: rgrimes@gndrsh.aac.dev.com, julian@tfs.com, freebsd-hackers@FreeBSD.org In-Reply-To: <199504050426.WAA09399@trout.sri.MT.net> from "Nate Williams" at Apr 4, 95 10:26:47 pm Content-Type: text Content-Length: 1167 Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Using cksum is *not* the way to go, we already have Pouls benchmarks > > of cmp vs cksum on this, and cksum is not fail safe, it is possible > > for 2 files to have the same checksum but contain different data, > > very unlikely, but possible. > > I would have to see it to believe it. And, I don't remember any of > Poul's benchmarks that you are speaking of just that he said his > memmap/memcmp stuff for CTM was faster than cksums. Well, to make the cksums you will have to read both files, lock stock and barrel. The CRC based checksums >HAVE< a window for collision, a byte for byte compare doesn't. Doing the compare is easier than the cksum, (1..3 instructions per 4 byte versus instructions). We have "install" in the vm-cache already, so exec'ing "cmp" will always take longer, plus the logic in the shell to look at the exit- code, plus people will invariably get it wrong in the Makefiles. QED: install is the place to do it, mmap+memcmp the way to do it. -- Poul-Henning Kamp -- TRW Financial Systems, Inc. 'All relevant people are pertinent' && 'All rude people are impertinent' => 'no rude people are relevant'