Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!ll-xn!ames!eos!jaw From: jaw@eos.UUCP (James A. Woods) Newsgroups: comp.unix.wizards Subject: Re: cmp Message-ID: <932@eos.UUCP> Date: 21 Jun 88 21:43:17 GMT References: <7993@alice.UUCP> Organization: NASA Ames Research Center, California Lines: 15 From article <7993@alice.UUCP>, by andrew@alice.UUCP: > > > on most implementations, cmp has two getchars (or getc's) in the inner loop. > we got a factor of five improvement by reading in blocks and using > memcmp. the 'cmp' on the cray two here is one of the rare unix commands which is vectorized, though some poor soul had to code the loop as a fortran subroutine (no vector C here). it doesn't count lines (though nobody cares, i don't believe this is inherently nonvectorizable). you might think a regular byte-oriented 'cmp' would be i/o bound on such a beast -- not true by a longshot; incidently this was one motivation for my development of boyer/moore/gosper 'egrep' two years back.