Skip to content

Avoid loading nearby fonts unless necessary - #15239

Merged
microsoft-github-policy-service[bot] merged 1 commit into
mainfrom
dev/lhecker/startup-perf-nearby-fonts
May 3, 2023
Merged

microsoft-github-policy-service[bot] merged 1 commit into
mainfrom
dev/lhecker/startup-perf-nearby-fonts

Conversation

@lhecker

@lhecker Leonard Hecker (lhecker) commented Apr 26, 2023 •

Copy link
Copy Markdown
Member

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
Leonard Hecker (lhecker) force-pushed the dev/lhecker/startup-perf-nearby-fonts branch from 1c679e4 to 0b678f1 Compare April 27, 2023 21:25
@lhecker
Leonard Hecker (lhecker) force-pushed the dev/lhecker/startup-perf-nearby-fonts branch from 0b678f1 to 615dccd Compare April 28, 2023 22:49
@lhecker
Leonard Hecker (lhecker) marked this pull request as ready for review April 28, 2023 22:52
@lhecker Leonard Hecker (lhecker) added Area-Performance Performance-related issue Product-Terminal The new Windows Terminal. labels Apr 28, 2023

@zadjii-msft Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

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 Leonard Hecker (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
Copy Markdown
Member

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