Closed Bug 1356828 Opened 7 years ago Closed 7 years ago

Stop calling getAddonById or getAddonList at startup

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

This forces the add-on DB to load, which we don't want.
There are also about a half dozen other places that force the DB to be loaded at startup:

12:14:48     INFO -  PID 14936 | _getActiveAddons@resource://gre/modules/TelemetryEnvironment.jsm:596:27

12:14:48     INFO -  PID 14936 | _getActiveTheme@resource://gre/modules/TelemetryEnvironment.jsm:647:24

12:14:48     INFO -  PID 14936 | _getActiveGMPlugins@resource://gre/modules/TelemetryEnvironment.jsm:723:28

12:14:48     INFO -  PID 14936 | installedExperimentAddons@resource:///modules/experiments/Experiments.jsm:169:10

12:14:48     INFO -  PID 14936 | _checkForSideloaded@resource:///modules/ExtensionsUI.jsm:50:5

In general, telemetry is only supposed to care about active add-ons. The same probably goes for experiments. We don't need to load the add-ons DB for those. We don't need to check for sideloads until after UI startup.
Summary: Pocket add-on should not call getAddonByID at startup → Stop calling getAddonById or getAddonList at startup
Depends on: 1356826
Comment on attachment 8858544 [details]
Bug 1356828: Don't call getAddonById from the Pocket bootstrap scope.

https://reviewboard.mozilla.org/r/130530/#review133178
Attachment #8858544 - Flags: review?(rhelmer) → review+
Pushed by maglione.k@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9c407d9e588b
Don't call getAddonById from the Pocket bootstrap scope. r=rhelmer
Backed out for failing xpcshell's test_shutdown.js:

https://hg.mozilla.org/integration/autoland/rev/3e373870b15edd7786734dd21e4140c55d3e44d7

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=9c407d9e588b5940ae7352591db430b913dc9ff7&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=93590071&repo=autoland

[task 2017-04-23T20:16:38.618955Z] 20:16:38     INFO -  TEST-START | xpcshell.ini:toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js
[task 2017-04-23T20:16:39.383745Z] 20:16:39  WARNING -  TEST-UNEXPECTED-FAIL | xpcshell.ini:toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js | xpcshell return code: 0
[task 2017-04-23T20:16:39.384174Z] 20:16:39     INFO -  TEST-INFO took 763ms
[task 2017-04-23T20:16:39.386764Z] 20:16:39     INFO -  >>>>>>>
[task 2017-04-23T20:16:39.390753Z] 20:16:39     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2017-04-23T20:16:39.392622Z] 20:16:39     INFO -  "AddonManager.getInstallForURL"
[task 2017-04-23T20:16:39.394682Z] 20:16:39     INFO -  "AddonManager.getInstallForFile"
[task 2017-04-23T20:16:39.396752Z] 20:16:39     INFO -  "AddonManager.getAddonByID"
[task 2017-04-23T20:16:39.402115Z] 20:16:39     INFO -  "AddonManager.getAddonBySyncGUID"
[task 2017-04-23T20:16:39.404022Z] 20:16:39     INFO -  "AddonManager.getAddonsByIDs"
[task 2017-04-23T20:16:39.405894Z] 20:16:39     INFO -  "AddonManager.getAddonsWithOperationsByTypes"
[task 2017-04-23T20:16:39.407722Z] 20:16:39     INFO -  "AddonManager.getAddonsByTypes"
[task 2017-04-23T20:16:39.409587Z] 20:16:39     INFO -  "AddonManager.getAllAddons"
[task 2017-04-23T20:16:39.411428Z] 20:16:39     INFO -  "AddonManager.getInstallsByTypes"
[task 2017-04-23T20:16:39.413228Z] 20:16:39     INFO -  "AddonManager.getAllInstalls"
[task 2017-04-23T20:16:39.415227Z] 20:16:39     INFO -  "AddonManager.isInstallEnabled"
[task 2017-04-23T20:16:39.417269Z] 20:16:39     INFO -  "AddonManager.isInstallAllowed"
[task 2017-04-23T20:16:39.419543Z] 20:16:39     INFO -  "AddonManager.installAddonFromWebpage"
[task 2017-04-23T20:16:39.421611Z] 20:16:39     INFO -  "AddonManager.installAddonFromAOM"
[task 2017-04-23T20:16:39.426845Z] 20:16:39     INFO -  "AddonManager.installTemporaryAddon"
[task 2017-04-23T20:16:39.428627Z] 20:16:39     INFO -  "AddonManager.installAddonFromSources"
[task 2017-04-23T20:16:39.430446Z] 20:16:39     INFO -  "AddonManager.getAddonByInstanceID"
[task 2017-04-23T20:16:39.432207Z] 20:16:39     INFO -  "AddonManagerPrivate.addonIsActive"
[task 2017-04-23T20:16:39.434079Z] 20:16:39     INFO -  addonIsActive threw an unexpected exception: TypeError: AddonManagerInternal._getProviderByName(...) is undefined
[task 2017-04-23T20:16:39.436007Z] 20:16:39     INFO -  /home/worker/workspace/build/tests/xpcshell/tests/toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js:test_functions:71
[task 2017-04-23T20:16:39.437963Z] 20:16:39     INFO -  /home/worker/workspace/build/tests/xpcshell/tests/toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js:run_test:78
[task 2017-04-23T20:16:39.442835Z] 20:16:39     INFO -  /home/worker/workspace/build/tests/xpcshell/head.js:_execute_test:536
[task 2017-04-23T20:16:39.444703Z] 20:16:39     INFO -  -e:null:1
[task 2017-04-23T20:16:39.446427Z] 20:16:39     INFO -  exiting test
[task 2017-04-23T20:16:39.448175Z] 20:16:39     INFO -  <<<<<<<
Flags: needinfo?(kmaglione+bmo)
https://hg.mozilla.org/integration/mozilla-inbound/rev/8f80e3456bfdfa1d4633478d52e288f85c3b71cf
Bug 1356828: Don't call getAddonById from the Pocket bootstrap scope. r=rhelmer
This has a performance win in sessionrestore!

== Change summary for alert #6145 (as of April 23 2017 21:05 UTC) ==

Improvements:

  3%  sessionrestore_no_auto_restore linux64 pgo e10s     629.17 -> 610.67
  3%  sessionrestore windows8-64 opt e10s                 809.21 -> 788.25
  3%  sessionrestore_no_auto_restore windows8-64 opt e10s 833.75 -> 812.92
  2%  sessionrestore windows8-64 opt                      845.42 -> 825.08
  2%  sessionrestore_no_auto_restore windows7-32 opt e10s 935.71 -> 915
  2%  sessionrestore linux64 opt e10s                     732 -> 715.92
  2%  sessionrestore_no_auto_restore linux64 opt e10s     762.08 -> 746.83

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=6145
https://hg.mozilla.org/mozilla-central/rev/8f80e3456bfd
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Comment on attachment 8858544 [details]
Bug 1356828: Don't call getAddonById from the Pocket bootstrap scope.

Approval Request Comment
[Feature/Bug causing the regression]: N/A
[User impact if declined]: This has a significant startup performance improvement which will help offset the impact of enabling Screenshots in beta.
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: No
[Needs manual test from QE? If yes, steps to reproduce]: N/A
[List of other uplifts needed for the feature/fix]: None
[Is the change risky?]: Low-risk
[Why is the change risky/not risky?]: This change is relatively simple, and only impacts the detection of the legacy Pocket add-on at startup, which in practice is lot likely to be necessary anymore.
[String changes made/needed]: None
Flags: needinfo?(kmaglione+bmo)
Attachment #8858544 - Flags: approval-mozilla-beta?
Blocks: 1356243
Blocks: webext-perf
Screenshots will go live in Fx55 so we don't have to uplift these patches in 54. Beta54-. Mark 54 won't fix.
Attachment #8858544 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: