-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Eliminate backtracking in the One node for some regex patterns
#51883
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
Conversation
|
Tagging subscribers to this area: @eerhardt, @pgovind Issue DetailsApply #51508 to the Follow up:
|
| if (len > i && _operator == RegexCode.Notoneloop) | ||
| { | ||
| TrackPush(len - i - 1, runtextpos - Bump()); | ||
| Debug.Assert(_maxBacktrackPosition == -1, $"maxBacktrackPosition = {_maxBacktrackPosition}, runtext = {runtext}, runtextpos = {runtextpos}, ch = {ch}, code = {_code}, runregex = {runregex}"); |
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.
Any assert failures stemming from this line are potential optimizations
| // If lastIndexOf is -1, we backtrack to the max extent possible. | ||
| runtextpos = _maxBacktrackPosition; | ||
| ReadOnlySpan<char> runtextSpan = runtext.AsSpan(_maxBacktrackPosition); | ||
| int lastIndexOf = runtextSpan.LastIndexOf(str); |
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.
Same questions as I had on the previous PR.
|
This PR is still draft. Won't have time to work on it until #51508 (and its follow up work) goes in. Adding the no-merge label just to be extra clear about it. If somebody wants me to close the PR in the meanwhile, let me know. |
|
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
Apply #51508 to the
Onenode.Follow up:
Compiledcode pathBenchmarks have been added to dotnet/performance#1788