On Fri, Jul 30, 1999 at 03:27:20PM +0200, Dag-Erling Smorgrav wrote:
> 
> Funnily, I experience a near-doubling of running time with similar
> patches.

Incidentally, it seems that it's not possible to assume that our
regex library is even anywhere in the same league as the GNU regex
library.

b$ time ./grep -E '(vt100)|(printer)' longfile > /dev/null

real    0m21.284s
user    0m22.034s
sys     0m0.083s

Now, with a profiled executable with optimization turned off it
takes about 25 seconds.  Regardless, it appears to spend 98% of
its time in regexec(), which is good, since that's where it should
be spending time.

[I had been intending to combine multiple patterns, ultimately
 combining in a '\n' to avoid the memchr() in mmopen].

b$ time grep '(vt100)|(printer)' longfile > /dev/null

real    0m0.267s
user    0m0.109s
sys     0m0.157s

98% * 20 = ~19...  Without an improved regex library, any mildly
complicated pattern will bring the new grep to its knees.

This could be the dfa helping GNU grep more than having a better
regexp library...  Probably both.

I wonder how well the devel/pcre port would do POSIX regular expressions.


-- 
This is my .signature which gets appended to the end of my messages.


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to