fix: remove performance cliff for regex#342
Conversation
|
Converted to draft because there are some weird edge cases that will have their results changed with what is currently here. For example, |
Hmmm...actually, it looks like it's fine because all the ones that no longer match will still match There's probably an opportunity to simplify/consolidate those regexes. If it is done carefully, it might be possible to do it in a way that positively impacts performance. |
mrmlnc
left a comment
There was a problem hiding this comment.
LGTM.
Right now we can skip optimizations of these regular expressions, since they are used at the earliest stage of analysis patterns: managers/tasks to separate patterns by type (static/dynamic) and providers/matchers/matcher to determinate the dynamic segment of the patterns.
|
Thanks again, @Trott 🎉 |
What is the purpose of this pull request?
Fixes a regex-backtracking performance cliff for some pathological cases.
What changes did you make? (Give an overview)
Replaced
.*in two places with matching lists[^(]and[^|]. Wrote tests to confirm performance cliffs in current code and their elimination with this change.