Skip to content
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

Extend SearchValues<string> use in Regex to NonBacktracking #103496

Merged
merged 1 commit into from
Jun 17, 2024

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.
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