Skip to content

Optimize parsing and serialization of generic type names in Xaml, decrease allocs #9940

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

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Oct 11, 2024

Description

Optimizes retrievals of subscripts/type names from generic types and also its serialization back to string.

This is meant to be very straightforward (as the main modification is done to GenericTypeNameScanner.StripSubscript and other modifications are just to comfort the change), so a lot of strings were kept, that's not an oversight. I believe those changes should be done in small batches.

Customer Impact

Improved performance, decreased allocations.

Regression

No.

Testing

Local build, unit tests.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

himgoyalmicro
himgoyalmicro previously approved these changes Mar 24, 2025
Copy link
Contributor

@himgoyalmicro himgoyalmicro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@himgoyalmicro
Copy link
Contributor

@h3xds1nz this PR is good to be merged. Can you please resolve the merge conflicts.

@h3xds1nz
Copy link
Member Author

@himgoyalmicro Done :)

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 11.23175%. Comparing base (b6914d7) to head (98b33ee).
Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main       #9940         +/-   ##
===================================================
- Coverage   11.45872%   11.23175%   -0.22697%     
===================================================
  Files           3214        3352        +138     
  Lines         648458      668017      +19559     
  Branches       71511       74983       +3472     
===================================================
+ Hits           74305       75030        +725     
- Misses        572989      591824      +18835     
+ Partials        1164        1163          -1     
Flag Coverage Δ
Debug 11.23175% <80.00000%> (-0.22697%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@himgoyalmicro himgoyalmicro merged commit 7d0a584 into dotnet:main Mar 24, 2025
8 checks passed
@himgoyalmicro
Copy link
Contributor

Thank you, @h3xds1nz, for your consistent and valuable contributions.

@h3xds1nz
Copy link
Member Author

@himgoyalmicro Thank you for reviewing :)

@github-actions github-actions bot locked and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants