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

Avoid loading nearby fonts unless necessary #15239

Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Apr 26, 2023

IDWriteFontSetBuilder is super expensive (~40ms of CPU for building a
single font set on a high-end CPU from ~2021). Let's avoid the cost,
by only constructing it if Cascadia Code is actually missing.
To not overcomplicate the code and to support any additional fonts we
might ship in the future, I'm not checking for the font name, and
instead I just construct the font set whenever any font is missing.

Part of #5907

Validation Steps Performed

  • Breakpoints in FontCache aren't hit ✅
  • App doesn't crash ✅

@lhecker lhecker force-pushed the dev/lhecker/startup-perf-nearby-fonts branch from 1c679e4 to 0b678f1 Compare April 27, 2023 21:25
@lhecker lhecker force-pushed the dev/lhecker/startup-perf-nearby-fonts branch from 0b678f1 to 615dccd Compare April 28, 2023 22:49
@lhecker lhecker marked this pull request as ready for review April 28, 2023 22:52
@lhecker lhecker added Area-Performance Performance-related issue Product-Terminal The new Windows Terminal. labels Apr 28, 2023
@zadjii-msft zadjii-msft added this to the Terminal v1.18 milestone May 1, 2023
@carlos-zamora carlos-zamora added the Needs-Second It's a PR that needs another sign-off label May 2, 2023
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

this is a clever solution. It won't help the folks for whom the font was broken on upgrade, but better to help most folks than help no one.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Second It's a PR that needs another sign-off label May 3, 2023
@lhecker lhecker added the AutoMerge Marked for automatic merge by the bot when requirements are met label May 3, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot deleted the dev/lhecker/startup-perf-nearby-fonts branch May 3, 2023 11:30
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

yes yes yes thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Performance-related issue AutoMerge Marked for automatic merge by the bot when requirements are met Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants