News for hackers. Stuff that matters.
Re:GNU grep 2.17, 10x faster by TobalJackson on Tuesday February 18, 2014 @01:20PM (#7259885)
taken from http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commit;h=97... 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 '['."

There are no comments on this comment yet.