Speed up regular expression substitution #91524
Labels
3.12
bugs and security fixes
performance
Performance or resource usage
topic-regex
type-feature
A feature request or enhancement
re.sub()
is relatively slow, because for every match it calls a Python code.Implementing it in C allows to speed up
re.sub()
to 2-3 times.Initially I also implemented a public API for explicit compilation of the replacement string, but then left it to a separate issue.
The text was updated successfully, but these errors were encountered: