Skip to content

Conversation

@ThomasGoulet73
Copy link
Contributor

@ThomasGoulet73 ThomasGoulet73 commented Oct 3, 2024

Description

I improved performance and allocations by using the new GetAlternateLookup introduced in .Net 9.0. This is a followup to #7794 where GetAlternateLookup wasn't available at the time.

Here's the result of my benchmark:

|          Method |     Mean |   Error |  StdDev | Ratio | RatioSD |   Gen0 | Allocated | Alloc Ratio |
|---------------- |---------:|--------:|--------:|------:|--------:|-------:|----------:|------------:|
| LookupFamilyOld | 344.6 ns | 4.59 ns | 4.29 ns |  1.00 |    0.00 | 0.0706 |   1.16 KB |        1.00 |
| LookupFamilyNew | 333.0 ns | 3.23 ns | 2.86 ns |  0.97 |    0.02 | 0.0687 |   1.13 KB |        0.97 |

Customer Impact

Better perf.

Regression

No.

Testing

I ran FamilyCollection.GetFontFromFamily with different combinations to make sure that the result was the same.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@himgoyalmicro himgoyalmicro merged commit f18b874 into dotnet:main Apr 1, 2025
@himgoyalmicro
Copy link
Contributor

Huge thanks to @ThomasGoulet73 for your continuous contributions😄😄

@ThomasGoulet73
Copy link
Contributor Author

Thanks @himgoyalmicro

@ThomasGoulet73 ThomasGoulet73 deleted the perf-font-FamilyCollection.GetFontFromFamily branch April 11, 2025 01:50
@github-actions github-actions bot locked and limited conversation to collaborators May 11, 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