GeezerVison is showing github.com — bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure · Pull Request #32223 · python/cpython
Conversation
ghost
commented
Apr 1, 2022
•
edited by ghost
Loading
Uh oh!
There was an error while loading. Please reload this page.
@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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
-_validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
+_validate_inner(SRE_CODE *code, SRE_CODE *end, PatternObject *self)
|
My internet connection is very bad last days, so it will take a time for review, sorry.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This pull request was closed.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.