grep-commit
[Top][All Lists]
Advanced

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

grep branch, master, updated. v2.18-109-g7eb003e


From: Paul Eggert
Subject: grep branch, master, updated. v2.18-109-g7eb003e
Date: Sun, 27 Apr 2014 20:02:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  7eb003e1625a9c4bd268fc46bad04c03ef7f0035 (commit)
      from  4c57448135ebd424c15c774ffba8a187e32bc0a3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=7eb003e1625a9c4bd268fc46bad04c03ef7f0035


commit 7eb003e1625a9c4bd268fc46bad04c03ef7f0035
Author: Paul Eggert <address@hidden>
Date:   Sun Apr 27 13:01:17 2014 -0700

    kwset: improve performance by inlining more
    
    Problem reported by Norihiro Tanaka in <http://bugs.gnu.org/17229#55>.
    * src/kwset.c (bmexec_trans): Rename from bmexec, and make it inline.
    (bmexec): New implementation, which calls bmexec_trans.  This helps
    GCC inline more aggressively with the default optimization, and
    improves performance 25% with the reported benchmark on my host.

diff --git a/src/kwset.c b/src/kwset.c
index 8270f05..8e9b510 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -584,9 +584,9 @@ memchr_kwset (char const *s, size_t n, kwset_t kwset)
   return n == 0 ? NULL : memchr2 (s, kwset->gc1, kwset->gc1help, n);
 }
 
-/* Fast boyer-moore search. */
-static size_t _GL_ATTRIBUTE_PURE
-bmexec (kwset_t kwset, char const *text, size_t size)
+/* Fast Boyer-Moore search (inlinable version).  */
+static inline size_t _GL_ATTRIBUTE_PURE
+bmexec_trans (kwset_t kwset, char const *text, size_t size)
 {
   unsigned char const *d1;
   char const *ep, *sp, *tp;
@@ -667,6 +667,17 @@ bmexec (kwset_t kwset, char const *text, size_t size)
   return -1;
 }
 
+/* Fast Boyer-Moore search.  */
+static size_t
+bmexec (kwset_t kwset, char const *text, size_t size)
+{
+  /* Help the compiler inline bmexec_trans in two ways, depending on
+     whether kwset->trans is null.  */
+  return (kwset->trans
+          ? bmexec_trans (kwset, text, size)
+          : bmexec_trans (kwset, text, size));
+}
+
 /* Hairy multiple string search. */
 static size_t _GL_ARG_NONNULL ((4))
 cwexec (kwset_t kwset, char const *text, size_t len, struct kwsmatch *kwsmatch)

-----------------------------------------------------------------------

Summary of changes:
 src/kwset.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

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