Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Apr 1, 2022

@serhiy-storchaka , please review the commits one by one.

MSVC 2022 non-PGO release build, run test_re.py. It's a bit slower.

(best of 10)
Before: 0.278 sec
After:  0.283 sec

But when switching REPEAT very frequently, it has some speed up:

import pyperf

setup = ("import re;"
         "s = 100_000_000 * 'a';"
         "p = r'.*?(?:bb)+';"
         "p = re.compile(p)")
stmt = "p.match(s)"

runner = pyperf.Runner()
runner.timeit("match", stmt=stmt, setup=setup)

# Before: Mean +- std dev: 1.88 sec +- 0.03 sec
# After:  Mean +- std dev: 1.63 sec +- 0.03 sec

https://bugs.python.org/issue23689

@serhiy-storchaka
Copy link
Member

My internet connection is very bad last days, so it will take a time for review, sorry.

@ghost
Copy link
Author

ghost commented Apr 1, 2022

It doesn't matter.

@ghost ghost closed this Apr 3, 2022
@ghost ghost deleted the repeat_array branch April 4, 2022 06:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants