
GNU grep 2.17, 10x faster - lelf
http://lists.gnu.org/archive/html/info-gnu/2014-02/msg00004.html
======
TobalJackson
taken from
[http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commit;h=97...](http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commit;h=97318f5e59a1ef6feb8a378434a00932a3fc1e0b)
it seems like the speedup was achieved in the most common case of usage, which
is with the -i switch (for case insensitive searching).

taken from the commit log:

"The trick is to realize that for some search strings, it is easy to convert
to an equivalent one that is handled much more efficiently. E.G. convert this
command:

    
    
      grep -i foobar k
    

to this:

    
    
      grep '[fF][oO][oO][bB][aA][rR]' k
    

That allows the matcher to search in buffer mode, rather than having to
extract/case-convert/search each line separately. Currently, we perform this
conversion only when search strings contain neither '\' nor '['."

------
reirob
From the NEWS section in the page:

 __Improvements

    
    
      grep -i in a multibyte locale is now typically 10 times faster
      for patterns that do not contain \ or [.
    
      grep (without -i) in a multibyte locale is now up to 7 times faster
      when processing many matched lines.

------
almosnow
Someone knows how was this achieved?

