GNU bug report logs - #16966
[PATCH] grep: optimization with the superset of DFA

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Sat, 8 Mar 2014 05:43:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 16966-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: Paolo Bonzini <bonzini <at> gnu.org>, 16966-done <at> debbugs.gnu.org
Subject: Re: bug#16966: [PATCH] grep: optimization with the superset of DFA
Date: Sun, 06 Apr 2014 22:08:53 -0700
[Message part 1 (text/plain, inline)]
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.
[0001-grep-optimization-with-the-superset-of-DFA.patch (text/plain, attachment)]
[0002-grep-cleanup-DFA-superset-optimization.patch (text/plain, attachment)]

This bug report was last modified 11 years and 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.