Holey files, Batman!

Jerry Aguirre jerry at oliveb.olivetti.com
Wed Mar 23 06:26:51 AEST 1988


In article <5356 at utah-cs.UUCP> donn at utah-cs.UUCP (Donn Seeley) writes:
>There are faster ways to do this if you don't need to be general about
>making holes, for example if you only deal with sequential copying of
>files.  We produced a modified 'cp' here at Utah that detects aligned
>blocks of zeroes in input and performs seeks instead of writes on
>output.  The detection of blocks of zeroes can be very cheap -- we find
>that it's faster to copy a file with zeroes in it using our modified
>'cp' than to copy it using the standard 'cp'.  Of course it helps that

I tried this one time also.  The problem is that each program requires a
separate solution.  Fixing "cp" does nothing about tar, ld, dd, etc.

Has anyone tried puting the zero test into "write".  As Donn pointed out
an "all zero" check will usually fail in the first byte of the block and
so is, on the average, cheap.

The only problem is I doubt a Vax750 can generate a block of zeros
faster than it can read it from disk.  I seem to remember that the
PDP-11 version of UNIX kept a block of zeros on disk to zero memory,
that being faster than a cpu loop to do the same.

				Jerry Aguirre



More information about the Comp.unix.wizards mailing list