Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Aug 2010 22:15:32 -0700
From:      Doug Barton <dougb@FreeBSD.org>
To:        Dimitry Andric <dimitry@andric.com>
Cc:        Justin Hibbits <chmeeedalf@gmail.com>, core@freebsd.org, delphij@freebsd.org, Gabor Kovesdan <gabor@freebsd.org>, Steve Kargl <sgk@troutmask.apl.washington.edu>, =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>, current@freebsd.org
Subject:   Re: Official request: Please make GNU grep the default
Message-ID:  <4C6A1AF4.6010909@FreeBSD.org>
In-Reply-To: <4C691629.4010006@andric.com>
References:  <4C6505A4.9060203@FreeBSD.org>	<20100813085235.GA16268@freebsd.org>	<4C66C010.3040308@FreeBSD.org>	<4C673F02.8000805@FreeBSD.org>	<20100815013438.GA8958@troutmask.apl.washington.edu>	<4C67492C.5020206@FreeBSD.org>	<B7A05068-9578-4341-851B-86BD9BC7A2DA@gmail.com>	<8639ufd78w.fsf@ds4.des.no> <4C6844D8.5070602@andric.com> <4C691629.4010006@andric.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C6A1AF4.6010909>