* Mike Haertel <m...@ducky.net> wrote:
> Moreover, GNU grep AVOIDS BREAKING THE INPUT INTO LINES.  Looking
> for newlines would slow grep down by a factor of several times,
> because to find the newlines it would have to look at every byte!

I think that implementing a simple fgrep boils down to mmap()ing a file
and calling memmem() on the mapping to search for the input string. Of
course this relies on having an efficient memmem() implementation, for
example using one of the algorithms mentioned in this thread.

-- 
 Ed Schouten <e...@80386.nl>
 WWW: http://80386.nl/

Attachment: pgp3jSdL5D2SW.pgp
Description: PGP signature

Reply via email to