Eliminate backtracking in the One node for some regex patterns#51883
Closed
pgovind wants to merge 6 commits intodotnet:mainfrom
Closed
Eliminate backtracking in the One node for some regex patterns#51883pgovind wants to merge 6 commits intodotnet:mainfrom
One node for some regex patterns#51883pgovind wants to merge 6 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @eerhardt, @pgovind Issue DetailsApply #51508 to the Follow up:
|
pgovind
commented
Apr 26, 2021
| 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}"); |
Author
There was a problem hiding this comment.
Any assert failures stemming from this line are potential optimizations
stephentoub
reviewed
May 26, 2021
| // If lastIndexOf is -1, we backtrack to the max extent possible. | ||
| runtextpos = _maxBacktrackPosition; | ||
| ReadOnlySpan<char> runtextSpan = runtext.AsSpan(_maxBacktrackPosition); | ||
| int lastIndexOf = runtextSpan.LastIndexOf(str); |
Member
There was a problem hiding this comment.
Same questions as I had on the previous PR.
Author
|
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. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apply #51508 to the
Onenode.Follow up:
Compiledcode pathBenchmarks have been added to dotnet/performance#1788