bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep --ignore-case efficiency


From: Paulo Nogueira
Subject: Re: grep --ignore-case efficiency
Date: Wed, 30 Jan 2013 18:44:00 +0000 (WET)
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)



 Thank you Arnold and Johannes for your comments.
 For convenience I'll do a mixed reply below.


The simple solution was to do

       export LC_ALL=C

and then run grep, which would give you a big speedup.


 Tried it and, indeed, this gives a big speedup!
 Comparable times on an old version of grep (2.5.1),
 but on a recent installation of Fedora (grep 2.14)
 it does not work just as well because it's still about
 10x slower (in my test case, with a simple text string).
 Ten times is still better than ninety times, although
 it's not expected after seing the result of grep 2.5



Have a look at
http://en.opensuse.org/SDB:Plain_Text_versus_Locale
in particular the section
"Processing UTF-8 is slower than ISO-8859 and ASCII"
and replace the "wc" tool therein with "grep".


 Tried also

 export LC_ALL=POSIX ; export LANG=POSIX

 as explained in the web page you cited, but still no
 improvements on Fedora 18. Maybe there is some other
 factor to take into account.

 Thanks,
   Paulo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]