Bug 106417

Summary: grep is very slow
Product: [Retired] Red Hat Linux Reporter: Justin Gullingsrud <justin>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:58:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Justin Gullingsrud 2003-10-06 22:10:26 UTC
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:
Always

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 08:32:08 UTC
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 18:58:59 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.