|Submitter||Diff||Changes||Open Issues||Last Updated|
|Error loading review requests:|
59 bytes, text/x-review-board-request
|Details | Review|
Here's a profile I captured: https://perf-html.io/public/20232669f468e741f89f237bc9612ec0c4792596/calltree/?range=127.2570_130.2583~128.8764_128.9363&thread=0 It looks like the blocklist updater is somehow kicking this off. This is the sort of papercut that can cause us to periodically jank the browser UI, and we should avoid this (or do a better job of hiding it) if at all possible.
Indeed, I can confirm: https://dxr.mozilla.org/mozilla-central/rev/722fdbff1efc308a22060e75b603311d23541bb5/toolkit/mozapps/extensions/nsBlocklistService.js#606-608 We could import the module on startup, especially now that it is enabled by default.
(In reply to Mathieu Leplatre (:leplatrem) from comment #1) > Indeed, I can confirm: > https://dxr.mozilla.org/mozilla-central/rev/ > 722fdbff1efc308a22060e75b603311d23541bb5/toolkit/mozapps/extensions/ > nsBlocklistService.js#606-608 > > We could import the module on startup, especially now that it is enabled by > default. We usually prefer to move as much as we can off the startup path. This may be another case where we need to run something on the ui thread while it is idle (ie. we would need bug 1353206).
Alternatively, (and I'm likely exposing my ignorance of what Kinto's function is in Firefox, but) is it possible to initialize the module lazily?
Mike, I submitted a patch that loads the module lazily. Let me know if that works for you :) Thanks for suggesting this!
Thanks leplatrem - while I did advise the change, I suspect MattN would be a better reviewer here (since I'm both on PTO, and also unfamiliar with this particular component).
Comment on attachment 8859924 [details] Bug 1357116 - Load the blocklist updater module lazily https://reviewboard.mozilla.org/r/131984/#review136826 Unfortunately this won't help, the "resource://services-common/blocklist-updater.js" module (and all its dependencies) will be imported synchronously when executing BlocklistUpdater.checkVersions(). From looking in the profile in comment 0, it seems accessing anything in Kinto initializes all (or most) of it synchronously. Or at least, it's in resource://services-common/blocklist-clients.js and its dependencies that the time is spent.
Thanks for your precious feedback! I was in the dark here.. I changed several direct imports to lazy module getters. Tests seem to pass locally :) Is there a way to also lazy load ``Cu.importGlobalProperties(["fetch"]);``?
Comment on attachment 8859924 [details] Bug 1357116 - Load the blocklist updater module lazily https://reviewboard.mozilla.org/r/131984/#review136922 Removing review flag for now as there are several test failures on try. The nsBlocklistService.js changes won't actually help performance, as the module will be loaded at the first BlocklistUpdater.checkVersions() call, and attempting to load again an already loaded module is cheap. But I don't mind if you keep them. The rest of the patch looks good to me, thanks! From code inspection I think it fixes the bug (but I haven't tried to test the patch locally). I'm ok with r+'ing these changes, but I'm not officially a reviewer for services/common. (In reply to Mathieu Leplatre (:leplatrem) from comment #9) > Is there a way to also lazy load ``Cu.importGlobalProperties(["fetch"]);``? XPCOMUtils.defineLazyGetter would probably work for that, but it doesn't seem useful. I think importing a global property is cheap.
Thanks for the feedback and your help :) > Removing review flag for now as there are several test failures on try. Sorry for that, I now fixed the code/tests. > I'm not officially a reviewer for services/common. I will request a review from Mark then.
Comment on attachment 8859924 [details] Bug 1357116 - Load the blocklist updater module lazily https://reviewboard.mozilla.org/r/131984/#review137362 Looks good to me, but let's wait for Mark's review :-).
Comment on attachment 8859924 [details] Bug 1357116 - Load the blocklist updater module lazily https://reviewboard.mozilla.org/r/131984/#review138492
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/83fe6517d5be Load the blocklist updater module lazily r=florian,mgoodwin
Backed out for eslint failures in blocklist-clients.js: https://hg.mozilla.org/integration/autoland/rev/ab3f508d6afd858476d61638b43a71b67f9250f2 Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=83fe6517d5bed5ee65f76618decb29389bfe383c&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=95997686&repo=autoland [task 2017-05-02T17:25:43.441953Z] TEST-UNEXPECTED-ERROR | /home/worker/checkouts/gecko/services/common/blocklist-clients.js:22:60 | Multiple spaces found before '"resource://services-common/kinto-offline-client.js"'. (no-multi-spaces) [task 2017-05-02T17:25:43.442074Z] TEST-UNEXPECTED-ERROR | /home/worker/checkouts/gecko/services/common/blocklist-clients.js:24:60 | Multiple spaces found before '"resource://services-common/kinto-storage-adapter.js"'. (no-multi-spaces) [task 2017-05-02T17:25:43.442153Z] TEST-UNEXPECTED-ERROR | /home/worker/checkouts/gecko/services/common/blocklist-clients.js:25:60 | Multiple spaces found before '"resource://gre/modules/CanonicalJSON.jsm"'. (no-multi-spaces)
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/4f511c0a0d70 Load the blocklist updater module lazily r=florian,mgoodwin