-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Regex's FindPrefixes handling for loops #98880
Conversation
We can factor in up to the minimum iteration count of the loop. This also makes handling a top-level alternation a bit cheaper.
|
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsWe can factor in up to the minimum iteration count of the loop. This also makes handling a top-level alternation a bit cheaper.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat
src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexPrefixAnalyzerTests.cs
Show resolved
Hide resolved
|
Possible improvements from this change: |
|
Nice. For dotnet/perf-autofiling-issues#29823 it seems there was an earlier regression that this unrelated improvement has canceled. Did we track that regression? Perhaps it was by design - I remember some regression due to correctness. |
|
While improving something is always nice, I don't think this PR could have improved those tests. Many of them don't use regex, and the ones that do, the pattern they use shouldn't have been impacted by this change. |


We can factor in up to the minimum iteration count of the loop.
This also makes handling a top-level alternation a bit cheaper.