[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

egrep performance with large standard quantifiers

From: Adam Monsen
Subject: egrep performance with large standard quantifiers
Date: Thu, 22 Jun 2006 16:49:43 -0700

I'm not sure if this is a bug, but does anyone have a clue why egrep is so
dang slow when using large standard quantifiers?

$ echo "foo" | time egrep -q '^.{1,2000}$'
11.65user 0.10system 0:11.75elapsed 100%CPU (0avgtext+0avgdata
0inputs+0outputs (0major+16326minor)pagefaults 0swaps

For reference, here's Perl:

$ echo "foo" | time perl -ne 'm/^.{1,2000}$/'
0.00user 0.00system 0:00.00elapsed 200%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+420minor)pagefaults 0swaps

Maybe the finger really points at pcre. I don't know.

I'm tried this with a few different versions, but for reference' sake,
here's what I was using:
grep 2.5.1
pcre 4.5
perl 5.8.5
(all from a standard CentOS 4.3 install)

Adam Monsen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]