GNU bug report logs - #17448
[PATCH] grep: retry DFA superset after matched with multiple lines by it

Previous Next

Package: grep;

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

Date: Fri, 9 May 2014 14:42: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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#17448: closed ([PATCH] grep: retry DFA superset after matched
 with multiple lines by it)
Date: Fri, 09 May 2014 21:54:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 09 May 2014 14:52:58 -0700
with message-id <536D4E3A.1010507 <at> cs.ucla.edu>
and subject line Re: bug#17448: [PATCH] grep: retry DFA superset after matched with multiple lines by it
has caused the debbugs.gnu.org bug report #17448,
regarding [PATCH] grep: retry DFA superset after matched with multiple lines by it
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
17448: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17448
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: retry DFA superset after matched with multiple lines by
 it
Date: Fri, 09 May 2014 23:40:48 +0900
[Message part 3 (text/plain, inline)]
Currently, when matched with multiple lines by DFA superset, return to
KWset.  However, it won't be wrong probably, because if matches with
multiple lines by DFA superset, also matches with single line there with
high probability.  Further more, if return to KWset after matched with
multiple line by DFA superset, dfafast won't work effectively.

This patch changes to retry DFA superset immediately after matched with
multiple lines by it.

I confirmed the patch by following tests.

  $ yes abcdabc | head -50000000 >k
  $ env LC_ALL=C time -p src/grep '\(ab\)cd\1d' k

  before:
    real 3.48       user 3.41       sys 0.06

  after:
    real 2.14       user 2.07       sys 0.06

Norihiro
[0001-grep-retry-DFA-superset-after-matched-with-multiple-.patch (text/plain, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17448-done <at> debbugs.gnu.org
Subject: Re: bug#17448: [PATCH] grep: retry DFA superset after matched with
 multiple lines by it
Date: Fri, 09 May 2014 14:52:58 -0700
[Message part 6 (text/plain, inline)]
Thanks, I installed that, along with the attached patch which improves 
it slightly by avoiding a test of the returned value of memrchr in a 
context where memrchr cannot return NULL, plus I redid the while-control 
to make it a bit clearer when the loop terminates.
[0001-grep-minor-improvements-to-retry-DFA-superset-patch.patch (text/plain, attachment)]

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

Previous Next


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