KEMBAR78
Extend SearchValues<string> use in Regex to NonBacktracking by stephentoub · Pull Request #103496 · dotnet/runtime · GitHub
Skip to content

Conversation

@stephentoub
Copy link
Member

We previously only enabled this for the compiler / source generator. Support it with NonBacktracking, too. We could easily enable it now for the interpreter as well... I've shied away from it not for technical reasons but because there is measurable cost associated with the analysis here, and we typically try to keep the interpreter construction relatively fast.

Method Toolchain Pattern Options Mean Ratio
Count \main\corerun.exe (?i)Sher[a-z]+|Hol[a-z]+ NonBacktracking 926.0 us 1.00
Count \pr\corerun.exe (?i)Sher[a-z]+|Hol[a-z]+ NonBacktracking 183.8 us 0.20
Count \main\corerun.exe (?i)Sherlock|Holmes|Watson NonBacktracking 2,087.0 us 1.00
Count \pr\corerun.exe (?i)Sherlock|Holmes|Watson NonBacktracking 160.4 us 0.08

We previously only enabled this for the compiler. Support it with NonBacktracking, too.
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants