Closed Bug 1669855 Opened 4 years ago Closed 3 years ago

Excessive jank due to reading font info after startup

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame, NeedInfo)

References

(Regressed 1 open bug)

Details

(Whiteboard: [bhr:gfxPlatformFontList::LoadFontInfo])

Attachments

(5 files)

See https://profiler.firefox.com/public/5mpr85tj7tkxb8mhz89rcp19e6x9arewrq46h7g.

This profile (from loading www.wikipedia.org in a newly-launched browser, IIUC) shows a lot of parent-process main-thread I/O that relates to loading font information. We should try to get this out of the startup path.

Bas, can you try the build from https://treeherder.mozilla.org/#/jobs?repo=try&revision=29e33675f3ea49bf4e4d173e47e3932fe7e2b26a and see if this makes a significant difference? It looks better in my local testing, but not sure how that'll compare to reference hardware.

Flags: needinfo?(bas)

Gerald, the profile in comment 0 is the profile you shared with the profiler team on Friday last week ("For your amusement and exploration, here's an all-threads profile with CPU and fileio, "shippable" win64 build taken on Acer ref laptop, cold-start after reboot, starting Firefox and then loading Wikipedia"). Any chance you can try the same thing with the build from comment 1?

Flags: needinfo?(gsquelart)

Is the work that InitOtherFamilyNames does something that must happen on the main thread?

(In reply to Florian Quèze [:florian] from comment #2)

... Any chance you can try the same thing with the build from comment 1?

Oops, I didn't read this properly, sorry. I built my own version, with the same patch that's in the build from comment 1, hopefully it's still useful.

Running my cold-start test on the Acer ref laptop: Boot, run firefox, wait 5s, go to wikipedia.

I'm seeing the same loads for ttf's 🤔 (But maybe I'm looking at the wrong thing?) Please let me know if I should try something else... Good luck!

Flags: needinfo?(gsquelart)

Thanks! So the fonts still get loaded, but the impact of those loads should be somewhat mitigated... if I'm looking at the right thing, what I see in the profile without the patch is an 8.8s reflow in the content process that's loading wikipedia.org (Web Content 3/3), and during that time the main process has a 6.6s jank marker.

Looking at the profile from the patched build, the content-process reflow of wikipedia.org is now 4.9s (i.e. reduced by 45%), and the corresponding main-process jank is broken up into numerous small slices rather than a single multi-second block. That should make for a less severe impact on the user experience.

So I think this indicates a step in the right direction, at least (though of course it'd be good to go further if we can).

Severity: -- → S3
Whiteboard: [bhr:gfxPlatformFontList::LoadFontInfo]
Summary: Excessive jank due to reading font info during initial load of www.wikipedia.org → Excessive jank due to reading font info after startup
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Blocks: 1679510

Hi Jonathan, do you have an update here? Is there anything which blocks landing the patches? All of them are reviewed meanwhile. Thanks.

Flags: needinfo?(jfkthame)

I'm hoping to land these soon, after a final run through tryserver, but am (mostly) on PTO at the moment so things are kinda slow...

Flags: needinfo?(jfkthame)
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cdf7e5db79db
Return a boolean from InitOtherFamilyNames to indicate whether the initialization is complete. r=jwatt
https://hg.mozilla.org/integration/autoland/rev/87186903dd5f
Add a primary-name-only parameter to FindFamily, to allow it to skip searching for aliases, and use this when initializing Windows font substitutions. r=jwatt
https://hg.mozilla.org/integration/autoland/rev/646176bf3689
Support triggering the background font-info loader immediately if it is currently deferred, and use this to implement InitOtherFamilyNames for the shared font list. r=jwatt
https://hg.mozilla.org/integration/autoland/rev/bd13128f1eb8
Don't block on InitOtherFamilyNames searching for a possible legacy family name in FindAndAddFamilies. r=jwatt
https://hg.mozilla.org/integration/autoland/rev/08a9a27605c5
Allow FindFamily to return a possible base family for a legacy styled-family name, as a temporary resolution until full font info is loaded. r=jwatt
Regressions: 1684846
Regressions: 1753169
See Also: → 1875278
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: