bug-gnu-utils
[Top][All Lists]
Advanced

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

the shorter the regexp, the longer the grep time


From: Dan Jacobson
Subject: the shorter the regexp, the longer the grep time
Date: Sat, 16 Aug 2003 02:38:45 +0800
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Gentlemen, what's the deal in that the shorter the regexp, the longer
the grep time?
# time zcat /var/log/syslog.*.gz|grep . > /dev/null
real    0m28.991s
user    0m28.990s
sys     0m0.000s
# time zcat /var/log/syslog.*.gz|grep fetchmail > /dev/null
real    0m6.556s
user    0m6.550s
sys     0m0.000s
# time zcat /var/log/syslog.*.gz|grep a > /dev/null
real    0m28.200s
user    0m28.190s
sys     0m0.010s
# grep --version
grep (GNU grep) 2.5.1




reply via email to

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