Bug 194472

Summary: grep --ignore-case is very slow in UTF-8
Product: [Fedora] Fedora Reporter: Egmont Koblinger <egmont>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-08 12:55:34 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 Egmont Koblinger 2006-06-08 12:52:33 UTC
Grep contains a lot of patches so that it is very fast even in UTF-8,
but only in the default case sensitive mode. If you type "grep -i
some_very_large_data" then you'll find that it is approx. a hundred times
slower than if you omit "-i". Example:

$ time grep foobar /usr/lib/locale/locale-archive

real    0m0.089s
user    0m0.044s
sys     0m0.048s
$ time grep -i foobar /usr/lib/locale/locale-archive

real    0m17.023s
user    0m16.977s
sys     0m0.044s

Note #1: I'm not using Fedora, but applied its patches (grep-2.5.1-52.2) to
grep 2.5.1a and recompiled it on my system and found this behavior there.

Note #2: If I apply the patches from SUSE's grep-2.5.1a-20 instead then it's
fast even in the case insensitive mode.

Note #3: "fgrep -i" is fast on Fedora, too.

Comment 1 Egmont Koblinger 2006-06-08 12:55:34 UTC
Sorry for the dup.

*** This bug has been marked as a duplicate of 194471 ***