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

Avoid RegexWriter for RegexOptions.Compiled, RegexOptions.NonBacktracking, and source generator #62450

Closed
stephentoub opened this issue Dec 6, 2021 · 2 comments · Fixed by #65986
Assignees
Milestone

Comments

@stephentoub
Copy link
Member

RegexWriter is used to convert a RegexNode tree into a series of opcodes and operands. These used to be used by all of the engines, but they're now only used for RegexInterpreter. With a bit of refactoring, we can avoid using RegexWriter at all for anything other than the interpreter.

@stephentoub stephentoub added this to the 7.0.0 milestone Dec 6, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Dec 6, 2021
@ghost
Copy link

ghost commented Dec 6, 2021

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

Issue Details

RegexWriter is used to convert a RegexNode tree into a series of opcodes and operands. These used to be used by all of the engines, but they're now only used for RegexInterpreter. With a bit of refactoring, we can avoid using RegexWriter at all for anything other than the interpreter.

Author: stephentoub
Assignees: -
Labels:

area-System.Text.RegularExpressions, tenet-performance

Milestone: 7.0.0

@joperezr joperezr removed the untriaged New issue has not been triaged by the area owner label Dec 6, 2021
@joperezr
Copy link
Member

Started to look a little onto this. Seeps like there is still small dependencies here and there on the NonBacktracking and Compiled engines for the emitted code. For example, the compiled engine makes some decisions based on the FindOptimizations object located inside the RegexCode. That said, we can easily refactor the FindOptimizations out of the RegexCode since creating it really only needs the culture and regex tree. Same goes for other things currently held by RegexCode like CapSize, Caps and TrackCount.

@stephentoub stephentoub self-assigned this Feb 28, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 1, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 2, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants