Re: Official request: Please make GNU grep the default

From: Alan Cox <alan.l.cox_at_gmail.com>
Date: Tue, 17 Aug 2010 11:29:50 -0500
2010/8/17 Dimitry Andric <dimitry_at_andric.com>

> On 2010-08-16 10:55, Dag-Erling Smørgrav wrote:
> > Dimitry Andric <dimitry_at_andric.com> writes:
> >> - Uses plain file descriptors instead of struct FILE, since the
> >>   buffering is done manually anyway, and it makes it easier to support
> >>   gzip and bzip2.
> > It might be worth a shot adding mmap(2) support as well, i.e. when
> > processing an uncompressed regular file, try to mmap(2) it first, and if
> > that fails, fall back to the plain buffered read(2) method.
>
> I added a simple mmap to grep, and time-trialed it, but the mmap version
> was somewhat slower than the regular version.  I understood from Kostik
> Belousov that readahead does not work properly with mmap, and it should
> not be used for "one-time" reads.
>
>

Try it again on a memory resident file with the MAP_PREFAULT_READ option
that is provided by this patch:

http://www.cs.rice.edu/~alc/MAP_PREFAULT_READ.patch

Regards,
Alan
Received on Tue Aug 17 2010 - 14:56:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:06 UTC