From owner-freebsd-current@FreeBSD.ORG Tue Aug 17 05:15:36 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2FCC10656A4 for ; Tue, 17 Aug 2010 05:15:36 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 959908FC14 for ; Tue, 17 Aug 2010 05:15:36 +0000 (UTC) Received: (qmail 9883 invoked by uid 399); 17 Aug 2010 05:15:35 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 17 Aug 2010 05:15:35 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4C6A1AF4.6010909@FreeBSD.org> Date: Mon, 16 Aug 2010 22:15:32 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2 MIME-Version: 1.0 To: Dimitry Andric 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> <8639ufd78w.fsf@ds4.des.no> <4C6844D8.5070602@andric.com> <4C691629.4010006@andric.com> In-Reply-To: <4C691629.4010006@andric.com> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Justin Hibbits , core@freebsd.org, delphij@freebsd.org, Gabor Kovesdan , Steve Kargl , =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , current@freebsd.org Subject: Re: Official request: Please make GNU grep the default X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2010 05:15:37 -0000 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