GNU bug report logs - #17143
[PATCH] grep: speed-up for line matching in fgrep

Previous Next

Package: grep;

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

Date: Sun, 30 Mar 2014 12:15:03 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17143 in the body.
You can then email your comments to 17143 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#17143; Package grep. (Sun, 30 Mar 2014 12:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Sun, 30 Mar 2014 12:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: speed-up for line matching in fgrep
Date: Sun, 30 Mar 2014 21:14:03 +0900
[Message part 1 (text/plain, inline)]
If fails in line matching at a position found by kwsexec(), the line
never matches in line matching.  So the line is skipped.

Norihiro
[patch.txt (text/plain, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#17143; Package grep. (Tue, 01 Apr 2014 08:46:01 GMT) Full text and rfc822 format available.

Message #8 received at 17143 <at> debbugs.gnu.org (full text, mbox):

From: Paolo Bonzini <bonzini <at> gnu.org>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17143 <at> debbugs.gnu.org
Subject: Re: bug#17143: [PATCH] grep: speed-up for line matching in fgrep
Date: Tue, 01 Apr 2014 10:45:12 +0200
Il 30/03/2014 14:14, Norihiro Tanaka ha scritto:
> -          if (beg > buf && beg[-1] != eol)
> -            continue;
> -          if (beg + len < buf + size && beg[len] != eol)
> -            continue;
> -          goto success;
> +          if (beg[-1] == eol && beg[len] == eol)
> +            goto success;
> +          beg = memchr (beg, eol, buf + size - beg);
>          }

Are we sure that beg > buf && beg + len < buf + size?

Perhaps we need

  if (beg > buf && beg[-1] == eol &&
      beg + len < buf + size && beg[len] == eol)
    goto success;

  beg = memchr (beg, eol, buf + size - beg);

Otherwise, the patch is an obvious improvement.  Thanks!

Paolo




Information forwarded to bug-grep <at> gnu.org:
bug#17143; Package grep. (Sun, 06 Apr 2014 10:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 17143 <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: 17143 <at> debbugs.gnu.org
Subject: bug#17143: [PATCH] grep: speed-up for line matching in fgrep
Date: Sun, 06 Apr 2014 19:04:05 +0900
Paolo, thanks for the review of the patch.  However, I found the better
solution than this patch in bug#17204 for this bug.  Please close this
bug without appling the patch.

Norihiro





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Sun, 06 Apr 2014 15:06:02 GMT) Full text and rfc822 format available.

Notification sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
bug acknowledged by developer. (Sun, 06 Apr 2014 15:06:03 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17143-done <at> debbugs.gnu.org
Subject: Re: bug#17143: [PATCH] grep: speed-up for line matching in fgrep
Date: Sun, 06 Apr 2014 08:04:58 -0700
Norihiro Tanaka wrote:
> Please close this bug

Thanks, done.  By the way, you can do this yourself, by sending email to 
the address <NNNNN-done <at> debbugs.gnu.org>.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 05 May 2014 11:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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