-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Optimize parsing/conversion of TextDecorations from string, reduce allocations #9778
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
Optimize parsing/conversion of TextDecorations from string, reduce allocations #9778
Conversation
...icrosoft.DotNet.Wpf/src/PresentationCore/System/Windows/TextDecorationCollectionConverter.cs
Outdated
Show resolved
Hide resolved
...icrosoft.DotNet.Wpf/src/PresentationCore/System/Windows/TextDecorationCollectionConverter.cs
Outdated
Show resolved
Hide resolved
...icrosoft.DotNet.Wpf/src/PresentationCore/System/Windows/TextDecorationCollectionConverter.cs
Outdated
Show resolved
Hide resolved
721af99
to
00c98c2
Compare
00c98c2
to
7b630e3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9778 +/- ##
===================================================
- Coverage 11.22814% 11.21368% -0.01446%
===================================================
Files 3352 3352
Lines 668000 667934 -66
Branches 74980 74971 -9
===================================================
- Hits 75004 74900 -104
- Misses 591745 591871 +126
+ Partials 1251 1163 -88
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
@dipeshmsft Any news on this one? We've merged the tests several weeks ago already for this one. |
Thanks @h3xds1nz for this contribution. |
@dipeshmsft Great, happy to see it in :) |
Description
Optimize parsing of
TextDecorations
from string intoTextDecorationCollection
, reduces allocations in all steps and improves performance, also reduces the memory footprint + readibility of the entire class by a large amount.TextDecorationNames
, that also removes the strings allocations on its own (not used anywhere else).PredefinedTextDecorations
, which was redundant from the start.ConvertFromString benchmarks
Customer Impact
Improved performance, decreased allocations.
Regression
No.
Testing
Local build, CI, extensive assert testing:
Risk
Should be safe, I believe I've tested thoroughly all cases and we shall have no surprises.
Microsoft Reviewers: Open in CodeFlow