MessageSend.jsm causes unnecessary loading of modules on startup
Categories
(MailNews Core :: Composition, defect)
Tracking
(thunderbird_esr78 unaffected)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | unaffected |
People
(Reporter: standard8, Assigned: rnons)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
3.41 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
MessageSend.jsm is loaded very early in startup, as it is not lazy loading its modules, it causes various other javascript modules to be loaded early than necessary.
On my machine with an SSD drive, it takes ~11ms to load all of these, on a HDD that is likely to be longer.
Things like:
var { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
Should be using:
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
OS: "resource://gre/modules/osfile.jsm",
});
or at worst, ChromeUtils.defineModuleGetter
.
If things are needed straight away (e.g. XPCOMUtils in the example above), they can be directly imported, otherwise we should be lazy loading to help our startup times.
Assignee | ||
Comment 1•5 years ago
|
||
Use defineLazyModuleGetters in MessageSend.jsm and SmtpService.jsm.
Assignee | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/cf4074b0e9f3
Use defineLazyModuleGetters in MessageSend.jsm and SmtpService.jsm. r=mkmelin
Updated•5 years ago
|
Description
•