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
Right now, regex are compiled upon every evaluation. This can lead to some punishing execution times when dealing with the regex operators.
There are three ways this can be helped:
When a regex operator's right-hand value is built entirely out of constants, that regex can be compiled at expression parsing time, rather than evaluation-time.
Users can give a precompiled regex directly to parameters. Instead of type-checking for only Strings, we can also look for *regexp.Regexp, preferring it if present.
When a regex operator compiles a regex for a given parameter, an internal cache can be made which maps the parameter's name and value to the compiled regex. This means that if a parameter doesn't change, its regex will (in effect) be statically compiled, similar to the above.
No guarantees about which of these will be implemented. All are subject to testing and benchmarking.
The text was updated successfully, but these errors were encountered:
Implemented pre-compilation of constant patterns in de9ed3b, and supported passing of *regexp.Regexp objects (into parameters) with a074485.
Ultimately decided against trying to do a cache of parameters used as regex which don't change between runs. It gets ugly, and turns into a bit of a hack where the reward is not worth the gain. Instead, going to defer the finer optimization points of using regex-that-doesn't-change in the docs - as part of #15. Users should compile their own regex and pass it as a parameter if they want to use a parameter as a regex.
Right now, regex are compiled upon every evaluation. This can lead to some punishing execution times when dealing with the regex operators.
There are three ways this can be helped:
*regexp.Regexp
, preferring it if present.No guarantees about which of these will be implemented. All are subject to testing and benchmarking.
The text was updated successfully, but these errors were encountered: