Avoid loading JSMs eagerly in ActivityStream.jsm and other Activity Stream modules
Categories
(Firefox :: New Tab Page, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: mconley, Assigned: mcheang)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [fxperf:p1])
Attachments
(1 file)
ActivityStream.jsm loads JSM's eagerly here:
It looks like this was done in bug 1376984 to avoid the overhead from XPCOMUtils.
Thankfully, I believe these days, ChromeUtils.defineModuleGetter has far less overhead than XPCOMUtils, so we might be able to make these JSMs lazy again - presuming there exist ones that aren't going to be used immediately after ActivityStream.jsm loads.
Here's a profile demonstrating the impact of loading all of these JSM's eagerly: https://perfht.ml/2YtTtEg
The time spans roughly 200ms.
I'll also note that the OnboardingMessageProvider.jsm also loads some JSMs eagerly here:
There might be some cheap start-up wins if we switch these all to use ChromeUtils.defineModuleGetter instead.
Reporter | ||
Comment 1•5 years ago
|
||
Here's an example of the impact of loading these JSMs eagerly on a fresh start (brand new profile):
This time is greatly magnified, probably because the JSMs aren't being loaded from the StartupCache - the imports span a period of about 4 seconds.
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Reporter | ||
Comment 3•5 years ago
|
||
I'm going to be on PTO next week, and will be unable to test this on my 2018 reference device frame recording rig... Scott, do you think you'd have a moment to test this patch to see what (if any) impact there is on cold start-up times for about:home?
Comment 4•5 years ago
|
||
Hey sorry just saw this (Holiday Monday through me off), yeah I can try to fit it in today or tomorrow. That work?
Assignee | ||
Comment 5•5 years ago
|
||
Hi Scott,
I think that will work. Thank you.
Comment 6•5 years ago
|
||
Looks like there is a benefit from making these changes, more details here: https://docs.google.com/document/d/1V3MEcS9bi-zMk-mLtoiVR7PN5gVlRGYz1o6u5SguzzY/edit#heading=h.u2htzavssm71
Comment 8•5 years ago
|
||
bugherder |
Description
•