Skip to content

Conversation

@stephentoub
Copy link
Member

If we end up with multiple identical pattern/options/timeout tuples in the same assembly, we don't need to emit unique code for each. We can still emit the partial implementation for each, but emit a single implementation of the Regex they all share.

If we end up with multiple identical pattern/options/timeout tuples in the same assembly, we don't need to emit unique code for each.  We can still emit the partial implementation for each, but emit a single implementation of the Regex they all share.
No reason we need a property here wrapping a compiler-generated backing field.
@stephentoub stephentoub added this to the 7.0.0 milestone Mar 17, 2022
@stephentoub stephentoub requested a review from joperezr March 17, 2022 01:20
@ghost ghost assigned stephentoub Mar 17, 2022
@ghost
Copy link

ghost commented Mar 17, 2022

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

Issue Details

If we end up with multiple identical pattern/options/timeout tuples in the same assembly, we don't need to emit unique code for each. We can still emit the partial implementation for each, but emit a single implementation of the Regex they all share.

Author: stephentoub
Assignees: -
Labels:

area-System.Text.RegularExpressions

Milestone: 7.0.0

@stephentoub stephentoub merged commit 26554c4 into dotnet:main Mar 18, 2022
@stephentoub stephentoub deleted the dedupregex branch March 18, 2022 17:56
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
* Dedup patterm/options/timeout in Regex source generator

If we end up with multiple identical pattern/options/timeout tuples in the same assembly, we don't need to emit unique code for each.  We can still emit the partial implementation for each, but emit a single implementation of the Regex they all share.

* Make the cached Regex members be static readonly fields

No reason we need a property here wrapping a compiler-generated backing field.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2022
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