Re: Replacing GNU grep revisited

[ Available lists | Index of freebsd-hackers | Month of Jun 2003 | Week of 23 Jun 2003 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Sean Farley <sean-freebsd@farley.org>
Date
23 Jun 2003 06:25:57
Subject
Re: Replacing GNU grep revisited
Message-ID
20030623080515.S43893@thor.farley.org

In reply to
Referenced by

[ Hide this part ]
On Mon, 23 Jun 2003, David Schultz wrote:

> On Sun, Jun 22, 2003, Sean Farley wrote:
> > On Sat, 21 Jun 2003, David Schultz wrote:
> >
> > 2. GNU's grep is using libgnuregex. The speed-up by dds@ would not
> > be felt?
>
> I was referring to freegrep, which I thought used the native libregex.

Yes, it does. I was just confused.

> In any case, if freegrep solves problems that GNU grep has, has the
> features people care about, is competitive in terms of performance,
> and has no known major bugs, then I would have no objections to it.
> As long as there are good technical reasons to switch, licensing
> advantages and performance are the least critical issues in my mind.
> We're not talking about a factor of 2, right?

It varies. Simpler searches are handled within FreeGrep such as
expressions with "^", "$" or ".". This is how GNU grep searches so
quickly; it "cheats" before it falls-back to the regex library.

More complex searches can hit the regex library and slow FreeGrep down.
In those cases, the ones I have found, it is still below a factor of
two difference. I usually do tests on /usr/src. I have seen FreeGrep
take 1:10 while GNU's grep took 0:58.

Interesting. I found that GNU's grep actually finds a match for "grep
-ail freebsd /usr/ports/distfiles/*":

/usr/ports/distfiles/ezm3

ezm3 is a directory with a filename that contains FreeBSD in it.

Sean
-----------------------
sean-freebsd@farley.org


Elapsed time: 0.137 seconds