diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-10-23 22:57:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-23 22:57:30 (GMT) |
commit | 75a6fadf369315b27e12f670e6295cf2c2cf7d7e (patch) | |
tree | cbf2004f870017f90874dc721e928da9412bab50 /Doc/whatsnew | |
parent | 176b6c57be70fb70fd0563813a87822545eb4bbf (diff) | |
download | cpython-75a6fadf369315b27e12f670e6295cf2c2cf7d7e.zip cpython-75a6fadf369315b27e12f670e6295cf2c2cf7d7e.tar.gz cpython-75a6fadf369315b27e12f670e6295cf2c2cf7d7e.tar.bz2 |
gh-91524: Speed up the regular expression substitution (#91525)
Functions re.sub() and re.subn() and corresponding re.Pattern methods
are now 2-3 times faster for replacement strings containing group references.
Closes #91524
Primarily authored by serhiy-storchaka Serhiy Storchaka
Minor-cleanups-by: Gregory P. Smith [Google] <greg@krypto.org>
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.12.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 3e0b106..8f8a994 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -205,6 +205,11 @@ Optimizations process, which improves performance by 1-5%. (Contributed by Kevin Modzelewski in :gh:`90536`.) +* Speed up the regular expression substitution (functions :func:`re.sub` and + :func:`re.subn` and corresponding :class:`re.Pattern` methods) for + replacement strings containing group references by 2--3 times. + (Contributed by Serhiy Storchaka in :gh:`91524`.) + CPython bytecode changes ======================== |