Official request: Please make GNU grep the default
Gabor Kovesdan
gabor at FreeBSD.org
Mon Aug 16 19:18:43 UTC 2010
Em 2010.08.15. 21:49, Dimitry Andric escreveu:
> GNU grep
> Elapsed time: 57 seconds
>
> BSD grep (original)
> Elapsed time: 820 seconds (~14.4x slower than GNU grep)
>
> BSD grep (quickfixed)
> Elapsed time: 115 seconds (~2.0x slower than GNU grep)
>
> It proves that getting rid of the fgetc's is certainly worthwhile, and I
> have attached a more complete patch that:
>
> - Replaces the horrendously inefficient grep_fgetln() with mostly the
> same implementation as the libc fgetln() function.
> - 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.
> - Let the bzip2 reader just read the file as plain data, when the
> initial magic number doesn't match, mimicking the behaviour of GNU
> grep.
>
> There is probably more room for optimization, but let's see if this
> survives a bunch of tests first. :)
>
Thanks Dmitry,
I've also started to work on a similar solution but you were extremely
fast. :) I'm checking your patch just now and will tell my experiences
if I see any regression.
Gabor
More information about the freebsd-current
mailing list