bug-grep
[Top][All Lists]
Advanced

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

bug#16966: [PATCH] grep: optimization with the superset of DFA


From: Paul Eggert
Subject: bug#16966: [PATCH] grep: optimization with the superset of DFA
Date: Sun, 06 Apr 2014 22:08:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Norihiro Tanaka wrote:
I rebased this patch, and added four fixes to it.

Thanks. This patch seems like a real performance win for grep -i in the usual case, so I installed it into the master. If we run into performance problems in unusual cases I suppose we can look into them as they arise.

In reviewing the patch I found one memory-access typo:

-              if ((end = memchr(beg, eol, buflim - beg)) != NULL)
...
+              if ((end = memchr(next_beg, eol, buflim - beg)) != NULL)

That last "beg" should be "next_beg".

I merged the patch into the current master on Savannah (first attached file) and then applied a fixup patch (second attached file) that fixes this bug and makes some other minor related improvements, e.g., using memrchr rather than looking for eol by hand.

Attachment: 0001-grep-optimization-with-the-superset-of-DFA.patch
Description: Text document

Attachment: 0002-grep-cleanup-DFA-superset-optimization.patch
Description: Text document


reply via email to

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