Subject: bug#17700: [PATCH] dfa: speed-up for a pattern that many atoms are catenated

From: Norihiro Tanaka <[email-masked]>
Date: Fri, 06 Jun 2014 07:49:22 +0900

Thanks.

Paul Eggert wrote:
> It seems to me that much of the performance benefit comes from using a
> faster implementation of strstr, and that the DFA code will be better
> off if it simply uses the system strstr rather than rolling its own.

`lookfor' isn't terminated by `\-'\0' in istrstr(), but strstr() requires
it.  So I wasn't replace it to strstr();

after `grep: undo part of previous change', no longer faster.

$ printf '%02048d\n' 0 | time -p src/grep -f - /dev/null

master  : real 5.74  user 5.40  sys 0.17
my patch: real 0.08  user 0.04  sys 0.04