You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm processing ~20,000 patterns, and I would rather not have them parsed/compiled a few times.
So I sre_parse them, and then use sre_compile.compile(p) to create the compiled pattern when needed. re.compile does those two steps anyway - the only difference is whether the compiled regex has the pattern attribute as a string containing the original regex.
The parsed (not compiled) version seems to be more suitable for keeping in memory for longer periods, as its size is more closely related to the string pattern length, while the compiled regex can be 8x the input string size.
The text was updated successfully, but these errors were encountered:
jayvdb
added a commit
to jayvdb/sre_yield
that referenced
this issue
Feb 16, 2020
I'm processing ~20,000 patterns, and I would rather not have them parsed/compiled a few times.
So I
sre_parse
them, and then usesre_compile.compile(p)
to create the compiled pattern when needed.re.compile
does those two steps anyway - the only difference is whether the compiled regex has thepattern
attribute as a string containing the original regex.The parsed (not compiled) version seems to be more suitable for keeping in memory for longer periods, as its size is more closely related to the string pattern length, while the compiled regex can be 8x the input string size.
The text was updated successfully, but these errors were encountered: