gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-966


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-966-g8dac7aa
Date: Sun, 14 Aug 2016 14:23:55 +0000 (UTC)

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 "gawk".

The branch, gawk-4.1-stable has been updated
       via  8dac7aaa475f205a4fe8ebfd27cd4c75775d6aef (commit)
      from  1e83ff34fa8a4a80e486169f24519864480320f4 (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.sv.gnu.org/cgit/gawk.git/commit/?id=8dac7aaa475f205a4fe8ebfd27cd4c75775d6aef

commit 8dac7aaa475f205a4fe8ebfd27cd4c75775d6aef
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Aug 14 17:23:38 2016 +0300

    Speedup regexp compilation if not using dfa.

diff --git a/ChangeLog b/ChangeLog
index f218714..9e5167e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-14         Arnold D. Robbins     <address@hidden>
+
+       * re.c (make_regexp): Only call dfasyntax if actually using
+       dfa. Gives a 14% speedup on this test: 
https://raw.githubusercontent.com/chadbrewbaker/awka/master/benchmark/regexp.awk.
+       From blathering in comp.lang.awk.
+
 2016-08-12         Arnold D. Robbins     <address@hidden>
 
        * dfa.c: Sync with GNU grep.
diff --git a/re.c b/re.c
index 5049bca..8a32530 100644
--- a/re.c
+++ b/re.c
@@ -203,10 +203,14 @@ make_regexp(const char *s, size_t len, bool ignorecase, 
bool dfa, bool canfatal)
                syn &= ~RE_ICASE;
        }
 
-       dfa_syn = syn;
-       if (ignorecase)
-               dfa_syn |= RE_ICASE;
-       dfasyntax(dfa_syn, ignorecase, '\n');
+       /* only call dfasyntax if we're using dfa; saves time */
+       if (dfa && ! no_dfa) {
+               dfa_syn = syn;
+               /* FIXME: dfa doesn't pay attention RE_ICASE */
+               if (ignorecase)
+                       dfa_syn |= RE_ICASE;
+               dfasyntax(dfa_syn, ignorecase, '\n');
+       }
        re_set_syntax(syn);
 
        if ((rerr = re_compile_pattern(buf, len, &(rp->pat))) != NULL) {

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

Summary of changes:
 ChangeLog |    6 ++++++
 re.c      |   12 ++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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