[macOS] Attempt to avoid the main thread being blocked on font-list initialization during startup
Categories
(Core :: Graphics: Text, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox120 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(2 files)
See profile: https://share.firefox.dev/3ZpfakC
This is a profile of launching a local (opt) mozilla-central build to about:blank.
It's noticeable here that during startup, the main thread is blocked (idle) for around 140ms while it waits for the InitFontList thread to complete.
| Assignee | ||
Comment 1•3 years ago
|
||
We register the gfxUserFontSet instance with the platform font list so that it can
be updated when necessary, if the font list changes such that src:local rules might
resolve differently. But if src:local is not used, the font set does not need to
be aware of the platform list, so we can make the connection only when a local
lookup is actually present.
This avoids blocking the main thread during startup, e.g. when we create a font set
for the -moz-bullet dataURI font that is part of the UA stylesheet.
Depends on D171205
Updated•3 years ago
|
| Assignee | ||
Comment 2•3 years ago
|
||
This method does not rely on any instance data, it just depends on system font APIs.
So it can be declared as static and used regardless of whether the platform font list
is fully initialized.
This avoids blocking on platform font list initialization when the widget code
calls LookupSystemFont during startup.
Depends on D171206
Updated•3 years ago
|
Comment 3•3 years ago
|
||
The severity field is not set for this bug.
:lsalzman, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:jfkthame, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
| Assignee | ||
Comment 5•3 years ago
|
||
I was seeing some test failures that proved difficult to resolve; still hoping to get back to this but it can't land as-is.
Comment 7•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/098ce7fab046
https://hg.mozilla.org/mozilla-central/rev/f1cebda4f6d6
Comment 8•2 years ago
|
||
(In reply to Pulsebot from comment #6)
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/098ce7fab046
Don't unconditionally access (and initialize) the platform font list from
gfxUserFontSet; it is only required for src:local faces.
r=gfx-reviewers,lsalzman
https://hg.mozilla.org/integration/autoland/rev/f1cebda4f6d6
Make gfxMacPlatformFontList::LookupSystemFont a static method.
r=gfx-reviewers,lsalzman
== Change summary for alert #39764 (as of Tue, 03 Oct 2023 10:59:02 GMT) ==
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 7% | sessionrestore_many_windows | macosx1015-64-shippable-qr | e10s fission stylo webrender-sw | 847.21 -> 792.17 |
| 5% | sessionrestore | macosx1015-64-shippable-qr | e10s fission stylo webrender | 1,096.92 -> 1,043.25 |
| 5% | sessionrestore_no_auto_restore | macosx1015-64-shippable-qr | e10s fission stylo webrender | 1,113.17 -> 1,061.42 |
| 4% | sessionrestore | macosx1015-64-shippable-qr | e10s fission stylo webrender | 1,086.25 -> 1,046.92 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=39764
Description
•