Bug 194472 - grep --ignore-case is very slow in UTF-8
Summary: grep --ignore-case is very slow in UTF-8
Keywords:
Status: CLOSED DUPLICATE of bug 194471
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-08 12:52 UTC by Egmont Koblinger
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-06-08 12:55:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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 ***


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