Bug 106417 - grep is very slow
grep is very slow
Status: CLOSED DUPLICATE of bug 69900
Product: Red Hat Linux
Classification: Retired
Component: grep (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2003-10-06 18:10 EDT by Justin Gullingsrud
Modified: 2007-04-18 12:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-02-21 13:58:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Justin Gullingsrud 2003-10-06 18:10:26 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

How reproducible:

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

Additional info:

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.
Comment 1 Tim Waugh 2003-10-07 04:32:08 EDT
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 ***
Comment 2 Red Hat Bugzilla 2006-02-21 13:58:59 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.