Closed erip closed 1 year ago
As a quick note: if I replace import re
with import regex as re
, the timeit microbenchmark is 1.62 s ± 117 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
. Quite the penalty just by switching the regex engine!
Compiles regexs where appropriate for improved perf for common operations (subs, searches, matches, finditers). Timeit info below for a microbenchmark (
MT1
is original w/o compilation,MT2
is new w/ compilation just for comparison -- this PR replaces the original impl).