Official request: Please make GNU grep the default
Doug Barton
dougb at FreeBSD.org
Tue Aug 17 05:15:37 UTC 2010
On 08/16/2010 03:42, Dimitry Andric wrote:
> On 2010-08-15 21:49, Dimitry Andric wrote:
>> ...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.
>
> Here is a new patch, updated against Gabor's changes in r211364.
Huge improvement!
r211364: With your patch:
./grep-time-trial
GNU grep
Elapsed time: 2 seconds
BSD grep BSD grep
Elapsed time: 33 seconds Elapsed time: 16 seconds
./grep-time-trial-2
GNU grep
Elapsed time: 3 seconds
BSD grep BSD grep
Elapsed time: 18 seconds Elapsed time: 11 seconds
--
Improve the effectiveness of your Internet presence with
a domain name makeover! http://SupersetSolutions.com/
Computers are useless. They can only give you answers.
-- Pablo Picasso
More information about the freebsd-current
mailing list