This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] More efficient fallback font selection #44526
Merged
Merged
Conversation
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
e0a57d3 to
13c7cb7
Compare
harryterkelsen
approved these changes
Aug 30, 2023
Contributor
harryterkelsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
Thanks so much for this contribution!
0dc0daf to
09ac60e
Compare
Contributor
Author
|
@eyebrowsoffire PTAL |
eyebrowsoffire
approved these changes
Aug 31, 2023
Contributor
eyebrowsoffire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for taking the time to do all this! This is going to be an amazing improvement.
09ac60e to
273a05c
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Aug 31, 2023
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Aug 31, 2023
…133820) flutter/engine@10e2df6...b867c4d 2023-08-31 [email protected] [web] More efficient fallback font selection (flutter/engine#44526) 2023-08-31 [email protected] Roll Dart SDK from ac3bc9f6351a to 9f9bd8cddfb0 (1 revision) (flutter/engine#45352) 2023-08-31 [email protected] Roll Skia from bf6b239838d3 to e1b27dcecd0a (1 revision) (flutter/engine#45349) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
8 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
platform-web
Code specifically for the web engine
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.
The PR improves the code size and runtime performance of fallback font selection.
Performance improvements
Initialization of the data structures to support fallback font selection has been moved from creating the FallbackFontManager (first frame) to the first use, i.e. the first frame actually needing a fallback font.
The numbers reported below are for a lightly edited version of the counter demo that appends to the counter about ~300 missing code points that need ~25 fallback fonts to cover the missing code points. Timings taken from a few profiles on my performance workstation.
Size improvements
Algorithm notes
Startup
The old algorithm built an interval tree from the code point ranges of the ~140 fallback fonts and uses the interval tree to build a list of fonts that support each missing code point. The new algorithm uses a binary search map that directly produces the list of fonts. There are fewer binary search ranges (~22k) than the aggregate ranges for all the fonts (~26k).
Most of the startup time gain comes from using a data unpacks directly into a useful form rather than needing processing to build an interval tree (~12ms vs ~100ms).
Running
The runtime for font selection is greatly improved for several reasons
Batching, incremental update and avoiding hash tables are roughly multiplicative in effect.
Issues
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.