3

[OS.File] Loading osfile.jsm is slow

 2 years ago
source link: https://bugzilla.mozilla.org/show_bug.cgi?id=1408729
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Details

(Keywords: perf, Whiteboard: [fxperf:p2])

See Bug 1063635

See Bug 1063635#c10

This is done by lazily loading osfile (and its individual modules) if possible or investigating those functions which are called during startup.
Continuing the work from https://bugzilla.mozilla.org/show_bug.cgi?id=1063635#c8 of the given bug, some more results using perf-html profiler.



* Currently, the first one to load osfile is GMPProvider.jsm followed by a very small usage by either CrashMonitor.jsm or SessionFile.jsm (varying on different startups). These seem to be the only users of the osfile in the first "event processing delay" on the main thread. 
Related profile: https://perfht.ml/2zDXoyL

* On patching GMPProvider.jsm to use a `defineLazyModuleGetter`, the first one to load osfile is ExtensionParent.jsm, followed by some SessionFile.jsm or CrashMonitor.jsm. Note that this (ExtensionParent) was not there in the last profile in the first "event processing delay". 
Related profile: https://perfht.ml/2zDBsUw

Based on this:
1. I'm unable to figure out why ExtensionParent is suddenly introduced to the startup even though it was not there previously (it uses a lazy getter as well already). Is there a way to investigate this?
2. I'm not sure why CrashMonitor and SessionFile only show up periodically (and in a seemingly random order). However, they seem to take up really small spaces on the time axis.
Flags: needinfo?(dteller)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK