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

Font loading impacts Windows desktop startup #8594

Open
jonathanpeppers opened this issue Jul 7, 2022 · 2 comments
Open

Font loading impacts Windows desktop startup #8594

jonathanpeppers opened this issue Jul 7, 2022 · 2 comments
Assignees
Labels
area-fonts Custom fonts and Font related API's legacy-area-perf Startup / Runtime performance platform/windows 🪟 proposal/open t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone

Comments

@jonathanpeppers
Copy link
Member

Description

~66ms is spent on my PC just loading fonts:

image

This was a dotnet new maui template, that has 2 fonts listed.

Speedscope file: PerfViewData.View1.perfView.xml.speedscope.json.zip

Public API Changes

n/a

Intended Use-Case

I think we could cut down the ~66ms spent by some order of magnitude.

@MartyIX
Copy link
Contributor

MartyIX commented Mar 14, 2024

(Sent over Discord, but maybe it's of some use even on Github)

I created https://github.com/MartyIX/maui/tree/feature/2024-03-14-font-testing (MartyIX@c1d76bc) where I add Ubuntu fonts and show 3 labels + there is a button to add a new label.

The Debug.WriteLine calls return:

XXX [FontManager.Windows.CreateFontFamily] CreateFontFamily UbuntuRegular
XXX [FontManager.Windows.CreateFontFamily] 201 ms ('formatted' length is 36 characters)
XXX [TextBlockExtensions.UpdateFont] FontManager.GetFontFamily executed in 213 ms.
XXX [TextBlockExtensions.UpdateFont] FontManager.GetFontFamily executed in 0 ms.
XXX [TextBlockExtensions.UpdateFont] FontManager.GetFontFamily executed in 0 ms.

(It was run in the Debug configuration though.)

The sample was done to show what happens when new Labels are added to the screen when the app is already started.

@Eilon Eilon added the t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) label May 10, 2024
@PureWeen PureWeen added the area-fonts Custom fonts and Font related API's label May 31, 2024
@MartyIX
Copy link
Contributor

MartyIX commented Jun 2, 2024

This PR #22782 would make this better not only for startup but even for the rest of an app's lifetime.

@PureWeen PureWeen modified the milestones: Under Consideration, Backlog Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-fonts Custom fonts and Font related API's legacy-area-perf Startup / Runtime performance platform/windows 🪟 proposal/open t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

No branches or pull requests

7 participants