Weave.js is expensive during early startup due to importing resource://services-sync/util.js

RESOLVED FIXED in Firefox 55

Status

()

Firefox
Sync
P1
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: florian, Assigned: eoger)

Tracking

(Blocks: 2 bugs)

unspecified
Firefox 55
Points:
---
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [photon-performance])

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(3 attachments)

(Reporter)

Description

a year ago
About 4% of the time before the first browser window is shown is spent in http://searchfox.org/mozilla-central/source/services/sync/Weave.js and almost all of the time spent there is importing resource://services-sync/util.js

I think this should be a lazy getter.

Here it is on a Mac startup profile: https://perfht.ml/2pNYWEq
Equivalent Windows profile: https://perfht.ml/2pO7v1W
(Reporter)

Comment 1

a year ago
Actually, Promise.jsm is visible in the profile too, so it would be nice to stop using it there and use a native promise instead.

FileUtils.jsm should also become a lazy getter... or maybe even better import it right before its only use in the file.
Flags: qe-verify?
Priority: -- → P2
There's a good chance that bug 1353571 will fix this.
(Reporter)

Comment 3

a year ago
(In reply to Mark Hammond [:markh] from comment #2)
> There's a good chance that bug 1353571 will fix this.

Ok, the current patches there don't seem to touch the Weave.js file, but as long as it gets fixed, I don't really care in which bug we do it :-).
Depends on: 1353571
(Reporter)

Updated

a year ago
Duplicate of this bug: 1361437
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 8

a year ago
Wish I could have done more and remove completely that Svc abomination, but it's a bit more work.
(Assignee)

Updated

a year ago
Assignee: nobody → eoger
Status: NEW → ASSIGNED

Comment 9

a year ago
mozreview-review
Comment on attachment 8863924 [details]
Bug 1358648 part 1 - Clean-up some Weave imports.

https://reviewboard.mozilla.org/r/135652/#review138674

::: services/common/utils.js:14
(Diff revision 1)
>  Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> -Cu.import("resource://gre/modules/osfile.jsm")
>  Cu.import("resource://gre/modules/Log.jsm");
> +XPCOMUtils.defineLazyModuleGetter(this, "OS",
> +                                  "resource://gre/modules/osfile.jsm");
> +XPCOMUtils.defineLazyModuleGetter(this, "Promise",

I believe we can just kill use of Promise.jsm and DOM promises should just magically work.
Attachment #8863924 - Flags: review?(markh) → review+

Comment 10

a year ago
mozreview-review
Comment on attachment 8863925 [details]
Bug 1358648 part 2 - Remove util.js Svc.{DefaultPrefs,Session,Idle, FormHistory} and Str.

https://reviewboard.mozilla.org/r/135654/#review138680
Attachment #8863925 - Flags: review?(markh) → review+

Comment 11

a year ago
mozreview-review
Comment on attachment 8863926 [details]
Bug 1358648 part 3 - Remove Async, Services and XPCOMUtils from util.js.

https://reviewboard.mozilla.org/r/135656/#review138690
Attachment #8863926 - Flags: review?(markh) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 18

a year ago
Pushed by eoger@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8d0b6d84a8e9
part 1 - Clean-up some Weave imports. r=markh
https://hg.mozilla.org/integration/autoland/rev/dff6d3f923d7
part 2 - Remove util.js Svc.{DefaultPrefs,Session,Idle, FormHistory} and Str. r=markh
https://hg.mozilla.org/integration/autoland/rev/9e6ae4133c2e
part 3 - Remove Async, Services and XPCOMUtils from util.js. r=markh
Priority: P2 → P1

Comment 19

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8d0b6d84a8e9
https://hg.mozilla.org/mozilla-central/rev/dff6d3f923d7
https://hg.mozilla.org/mozilla-central/rev/9e6ae4133c2e
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Iteration: --- → 55.5 - May 15
(Reporter)

Updated

a year ago
Blocks: 1355956
(Reporter)

Updated

a year ago
No longer blocks: 1348289
(Reporter)

Updated

a year ago
Blocks: 1348289
Flags: qe-verify? → qe-verify-
You need to log in before you can comment on or make changes to this bug.