Speed up regular expression substitution #91524
Labels
3.12
expert-regex
performance
Performance or resource usage
type-feature
A feature request or enhancement
serhiy-storchaka commentedApr 14, 2022
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: