Optimize FontSourceCollection creation from a filesystem directory, reduce allocs#9844
Open
h3xds1nz wants to merge 10 commits into
Open
Optimize FontSourceCollection creation from a filesystem directory, reduce allocs#9844h3xds1nz wants to merge 10 commits into
h3xds1nz wants to merge 10 commits into
Conversation
8ed3af8 to
2d57793
Compare
Member
Author
|
Resolved merge conflicts 11 |
2d57793 to
ada2d0e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9844 +/- ##
===================================================
+ Coverage 11.25778% 11.40499% +0.14720%
===================================================
Files 3315 3316 +1
Lines 665229 665209 -20
Branches 74668 74671 +3
===================================================
+ Hits 74890 75867 +977
+ Misses 589035 587938 -1097
- Partials 1304 1404 +100
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Member
Author
|
Rebased and moved things to ctor so that fields can be However, no code/logic changes have been done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Optimizes building of
FontSourceCollectionand also some work inFontResourceCache.Path.GetExtensionhas a span variant, this prevents string creation just to checkIsSupportedFontExtension.SupportedExtensionsstatic array has been removed as it is not needed for anything, anymore.isWindowsFontsfrom the previous PR, hence why this is a draft.Directory.GetFiles, we will use the underlying implementation on .NET Core; theFileSystemEnumerable.Directory.GetFiles(string)does (Compatible).MatchTypeto be specified at all (which would be Win32), so it is not.file://, we will no longer allocate astring[]of 1.416 files in directory, no matches
351 files in directory, 156 matches
5 files, 1 match
1 file, 1 match
Customer Impact
Decreased allocations, increased performance when initializing from directory.
I've observed about 3-4ms improvement when building from
Fontsdirectory (351 files; 156 matches).Regression
No.
Testing
Local build, initializing the collection with folders to look in, testing the functinality via
FontFamilychange.Risk
Low, this is rather simple 1:1 swap. Options for
FileSystemEnumerablewere copied forGetFilescodepath.Microsoft Reviewers: Open in CodeFlow