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

Remove unnecessary array allocations in SelectionProcessor/SubTreeProcessor #9597

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Aug 18, 2024

Description

Removes unnecessary static array allocations of XmlQualifiedName and their subsequent clones on getters, replacing it with simple ReadOnlySpan<XmlQualifiedName> returning a reference to a static field.

Also replaces GetSelectedNodes to return a ReadOnlySpan<DependencyObject> which can then be used in BuildPathForElements for faster enumeration and strongly-typed access.

Customer Impact

Improved performance, decreased allocations.

Regression

No.

Testing

Local build, CI.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners August 18, 2024 11:24
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions Included in test pass PR metadata: Label to tag PRs, to facilitate with triage Status:Cut Status:Proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants