Closed
Bug 988051
Opened 8 years ago
Closed 8 years ago
Lazily load FxAccountsClient.jsm
Categories
(Firefox :: Firefox Accounts, defect)
Firefox
Firefox Accounts
Tracking
()
RESOLVED
FIXED
Firefox 31
People
(Reporter: MattN, Assigned: markh)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Memshrink])
Attachments
(1 file, 1 obsolete file)
1.58 KB,
patch
|
rnewman
:
review+
Sylvestre
:
approval-mozilla-aurora+
Sylvestre
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
I verified these two modules aren't loaded on startup in a clean profile after the change. Try push: https://tbpl.mozilla.org/?tree=Try&rev=e068de02cb0b
Attachment #8396769 -
Flags: review?(rnewman)
Assignee | ||
Comment 1•8 years ago
|
||
It seems this might be attacking the wrong end of the problem - eg, we should only be loading hawkclient once we know it's going to be used - at which point deferring the import of hawkrequest probably doesn't buy anything as it would immediately be used. IOW, we probably want to defer hawkclient itself in the modules that use it. I think a bigger bang-for-buck would be to look at FxAccounts.jsm - many of the modules there are only used if a user is logged in, which will not be true for a clean profile. Once lazy imports there are loaded, I'm not sure there's huge benefit in subsequent lazy-loads as they are almost certainly going to be used relatively quickly after import.
Assignee | ||
Comment 2•8 years ago
|
||
eg, this patch avoids ~12 modules loading
Comment 3•8 years ago
|
||
Comment on attachment 8396769 [details] [diff] [review] v.1 defineLazyModuleGetter Yeah, I'm in favor of moving the laziness up to the decision point of the functionality, rather than swizzling it in throughout. Any user of hawkclient.js will very shortly use hawkrequest.js, so we're not really saving anything.
Attachment #8396769 -
Flags: review?(rnewman)
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8396840 [details] [diff] [review] Lazy FxAccounts How about this one then? :) I'll update the bug title accordingly if this gets review.
Attachment #8396840 -
Flags: review?(rnewman)
Updated•8 years ago
|
Attachment #8396840 -
Flags: review?(rnewman) → review+
Assignee | ||
Updated•8 years ago
|
Attachment #8396769 -
Attachment is obsolete: true
Assignee | ||
Comment 5•8 years ago
|
||
awesome, thanks! https://hg.mozilla.org/integration/fx-team/rev/26719e92872b
Assignee: MattN+bmo → mhammond
Summary: Lazily load hawkrequest.js and Credentials.jsm → Lazily load FxAccountsClient.jsm
Assignee | ||
Comment 6•8 years ago
|
||
If this sticks (it should; xpcshell tests all worked locally!) then we should probably uplift it.
status-firefox29:
--- → affected
status-firefox30:
--- → affected
status-firefox31:
--- → affected
tracking-firefox29:
--- → ?
Reporter | ||
Comment 7•8 years ago
|
||
Thanks Mark!
![]() |
||
Comment 8•8 years ago
|
||
> this patch avoids ~12 modules loading
\o/
Updated•8 years ago
|
Comment 9•8 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/26719e92872b
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Reporter | ||
Updated•8 years ago
|
Assignee | ||
Comment 10•8 years ago
|
||
Comment on attachment 8396840 [details] [diff] [review] Lazy FxAccounts [Approval Request Comment] Bug caused by (feature/regressing bug #): FxA Sync User impact if declined: Higher Fx memory usage when no FxA user logged in Testing completed (on m-c, etc.): Landed on m-c Risk to taking this patch (and alternatives if risky): Low String or IDL/UUID changes made by this patch: None
Attachment #8396840 -
Flags: approval-mozilla-beta?
Attachment #8396840 -
Flags: approval-mozilla-aurora?
Updated•8 years ago
|
Attachment #8396840 -
Flags: approval-mozilla-beta?
Attachment #8396840 -
Flags: approval-mozilla-beta+
Attachment #8396840 -
Flags: approval-mozilla-aurora?
Attachment #8396840 -
Flags: approval-mozilla-aurora+
Comment 11•8 years ago
|
||
Comment on attachment 8396840 [details] [diff] [review] Lazy FxAccounts >diff --git a/services/fxaccounts/FxAccounts.jsm b/services/fxaccounts/FxAccounts.jsm > Cu.import("resource://gre/modules/Timer.jsm"); > Cu.import("resource://gre/modules/FxAccountsCommon.js"); > Cu.import("resource://gre/modules/FxAccountsUtils.jsm"); Shouldn't some of these be lazy-loaded too? Is there another bug for that?
Assignee | ||
Comment 12•8 years ago
|
||
(In reply to :Gavin Sharp (email gavin@gavinsharp.com) from comment #11) > Comment on attachment 8396840 [details] [diff] [review] > Lazy FxAccounts > > >diff --git a/services/fxaccounts/FxAccounts.jsm b/services/fxaccounts/FxAccounts.jsm > > > Cu.import("resource://gre/modules/Timer.jsm"); > > Cu.import("resource://gre/modules/FxAccountsCommon.js"); > > Cu.import("resource://gre/modules/FxAccountsUtils.jsm"); > > Shouldn't some of these be lazy-loaded too? Is there another bug for that? Personally I'm not bothered by them. FxAccountsUtils will be immediately be used (and should die IMO anyway), FxAccountsCommon ideally would, but it's imported without a "namespace" so this change would be far more intrusive, and I see Timer.jsm like Log.jsm - a general utility module that's likely to be already loaded.
Comment 13•8 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/d46c23f82bfa https://hg.mozilla.org/releases/mozilla-beta/rev/0fc15cf33a3c
Updated•5 years ago
|
Product: Core → Firefox
Updated•5 years ago
|
Target Milestone: mozilla31 → Firefox 31
You need to log in
before you can comment on or make changes to this bug.
Description
•