[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching
From: |
Pantxo Diribarne |
Subject: |
[Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching |
Date: |
Thu, 17 Oct 2019 09:21:54 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 |
Update of bug #57064 (project octave):
Item Group: Unexpected Error => Regression
Status: None => Confirmed
Summary: regexp hangs in infinite loop => Severe slowdown of
regexp matching
_______________________________________________________
Follow-up Comment #6:
After earching for "pcre utf8 slow" I've read that if the string can be safely
assumed to be utf8, then one can by-pass a time consuming check using the
PCRE_NO_UTF8_CHECK option. With this option tst.m returns in 1 s while it
takes 51 s without it.
I used the following diff:
diff -r 25479159213b liboctave/util/lo-regexp.cc
--- a/liboctave/util/lo-regexp.cc Wed Oct 16 14:35:03 2019 -0700
+++ b/liboctave/util/lo-regexp.cc Thu Oct 17 15:19:09 2019 +0200
@@ -280,7 +280,7 @@
int matches = pcre_exec (re, nullptr, buffer.c_str (),
buffer.length (), idx,
- (idx ? PCRE_NOTBOL : 0),
+ PCRE_NO_UTF8_CHECK | (idx ? PCRE_NOTBOL :
0),
ovector, (subpatterns+1)*3);
if (matches == PCRE_ERROR_MATCHLIMIT)
@@ -307,7 +307,8 @@
pe.match_limit *= 10;
matches = pcre_exec (re, &pe, buffer.c_str (),
buffer.length (), idx,
- (idx ? PCRE_NOTBOL : 0),
+ PCRE_NO_UTF8_CHECK
+ | (idx ? PCRE_NOTBOL : 0),
ovector, (subpatterns+1)*3);
}
}
Updating the title, item group and status
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57064>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, A.R. Burgers, 2019/10/16
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, Dmitri A. Sergatskov, 2019/10/16
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, A.R. Burgers, 2019/10/16
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, Markus Mützel, 2019/10/16
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, A.R. Burgers, 2019/10/16
- [Octave-bug-tracker] [bug #57064] regexp hangs in infinite loop, Markus Mützel, 2019/10/16
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching,
Pantxo Diribarne <=
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Markus Mützel, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Pantxo Diribarne, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Pantxo Diribarne, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Markus Mützel, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Markus Mützel, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Pantxo Diribarne, 2019/10/17
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, A.R. Burgers, 2019/10/18
- [Octave-bug-tracker] [bug #57064] Severe slowdown of regexp matching, Markus Mützel, 2019/10/18