mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30340: Enhanced regular expressions optimization. (#1542)
This increased the performance of matching some patterns up to 25 times.
This commit is contained in:
parent
cbddf58c79
commit
821a9d146b
4 changed files with 95 additions and 54 deletions
|
@ -1695,20 +1695,18 @@ class ReTests(unittest.TestCase):
|
|||
dump = '''\
|
||||
SUBPATTERN 1 0 0
|
||||
LITERAL 46
|
||||
SUBPATTERN None 0 0
|
||||
BRANCH
|
||||
IN
|
||||
LITERAL 99
|
||||
LITERAL 104
|
||||
OR
|
||||
LITERAL 112
|
||||
LITERAL 121
|
||||
SUBPATTERN None 0 0
|
||||
GROUPREF_EXISTS 1
|
||||
AT AT_END
|
||||
ELSE
|
||||
LITERAL 58
|
||||
LITERAL 32
|
||||
BRANCH
|
||||
IN
|
||||
LITERAL 99
|
||||
LITERAL 104
|
||||
OR
|
||||
LITERAL 112
|
||||
LITERAL 121
|
||||
GROUPREF_EXISTS 1
|
||||
AT AT_END
|
||||
ELSE
|
||||
LITERAL 58
|
||||
LITERAL 32
|
||||
'''
|
||||
self.assertEqual(out.getvalue(), dump)
|
||||
# Debug output is output again even a second time (bypassing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue