Closed Bug 1620111 Opened 5 years ago Closed 5 years ago

Avoid synchronous ReadFontList IPC message

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Performance Impact high
Tracking Status
firefox76 --- fixed

People

(Reporter: mstange, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

(Keywords: perf:pageload, Whiteboard: [fission-perf])

Attachments

(1 file)

Profile: https://perfht.ml/2vvhnTm (2ms profiling interval, GeckoView example on a Moto G5, remote debugging enabled)

During content process startup, the content process sends a synchronous IPC message ReadFontList to the parent process. If the parent process happens to be busy at the time, this message can block the content process for an extended time - 450ms in this example.

We should try to eliminate this synchronous message.

Whiteboard: [qf] → [qf][fission-perf]

Yeah, this should be feasible: instead of having the content process "pull" the font list by sending a message to the parent (which potentially blocks for a long time, as here), we can make the parent "push" the list as part of the XPCOMProcessAttributes it passes when it starts the child. That's what we do on macOS and Linux (https://searchfox.org/mozilla-central/rev/c79c0d65a183d9d38676855f455a5c6a7f7dadd3/dom/ipc/ContentParent.cpp#2408-2409); we should rearrange the Android code to work the same way.

Whiteboard: [qf][fission-perf] → [qf:p1:pageload][fission-perf]
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED

This should avoid the extra sync message.

(Markus, if you have a chance to try profiling this for comparison, there's a try build at https://treeherder.mozilla.org/#/jobs?repo=try&revision=2323b23e32532b3b553bbfb22098f6f98387f3f9.)

Works great! Thanks!
Before: https://perfht.ml/39wFgbM After: https://perfht.ml/2wzMkpp
(I applied the patch locally and didn't use the try build.)

Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b2eb9f51db33 Eliminate sync-IPC message ReadFontList, instead use SetXPCOMProcessAttributes to pass font list to the child process on Android. r=lsalzman,froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Performance Impact: --- → P1
Keywords: perf:pageload
Whiteboard: [qf:p1:pageload][fission-perf] → [fission-perf]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: