Red Hat Bugzilla – Bug 106417
grep is very slow
Last modified: 2007-04-18 12:58:10 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/85.7 (KHTML, like Gecko) Safari/85.5
Description of problem:
grep runs pathologically slowly on both uniprocessor and smp Intel machines when the file contains many lines with a match on the pattern.
Version-Release number of selected component (if applicable):
grep-2.5.1-7, kernel-2.4.20-20.9, glibc-2.2.5-34
Steps to Reproduce:
time grep " " /etc/init.d/functions > /dev/null
Actual Results: 0.14 seconds on a dual 2.4GHz P4.
Expected Results: 0.01 seconds or less, as on RedHat 7.3
This takes 0.68 seconds on a 500 MHz PIII, 0.14 seconds on a dual 2.4 GHz P4. An Athlon running RedHat 7.3, kernel-2.4.18-10, and glibc-2.2.5-34 does not suffer from this problem. Using grep-2.5.1-1 has the same problem. The time scales with file size.
Known issue. See the grep-2.5.1-gofast.patch in the source rpm for how far I
got with it before giving up and reporting it upstream.
*** This bug has been marked as a duplicate of 69900 ***
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.