Closed Bug 1660268 Opened 4 years ago Closed 4 years ago

Make the ResourceWatcher emit many resources instead of just one

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(firefox82 fixed)

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(3 files)

I suspect in bug 1620280 that the performance regression is related to the fact that we process JS Sources one by one.
Today, the ResourceWatcher.watch will call the onAvailable, onUpdated and onDestroyed arguments once per resource.
But internaly, this class receives resources by bulk, an array of resources.
So that it would be great to also pass them to the frontend as a list.
It would help the frontend do bulk updates. It would also help control how bulk works in the ResourceWatcher instead of doing it differently in each individual panel.

In order to do that, we should first make it so that we ready resourceType and targetFront from the resource object instead of reading it from the argument of the on*** functions.
That's because we could pass resources of multiple types and distinct targets.

Here, I've tried to be especially careful about replacing return by continue in the added for..loops.

Status: NEW → ASSIGNED
Whiteboard: dt-fission-m2-mvp
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7ec118209790 Read resourceType from resource instead of onResource*** functions. r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/9d4c305f6b88 Read targetFront from resource instead of onResource*** functions. r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/749fda4e5eb1 Pass list of resources instead of unique resource from ResourceWatcher. r=nchevobbe

Backed out for failures on browser_ext_devtools_network_targetSwitch.js

backout: https://hg.mozilla.org/integration/autoland/rev/ca131344e7fcf46f50e09bea63141d2578f18b7b

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=749fda4e5eb11918833fa57e25adc77e4ed1db95&group_state=expanded

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=315030609&repo=autoland&lineNumber=7730

[task 2020-09-07T17:41:47.991Z] 17:41:47 INFO - Console message: [JavaScript Error: "TypeError: can't access property "isTopLevel", targetFront is undefined" {file: "resource://gre/modules/ExtensionParent.jsm" line: 746}]
[task 2020-09-07T17:41:47.992Z] 17:41:47 INFO - Buffered messages logged at 17:35:42
[task 2020-09-07T17:41:47.994Z] 17:41:47 INFO - Console message: [JavaScript Error: "Unknown Collection "main/nimbus-desktop-experiments"" {file: "resource://services-settings/RemoteSettingsClient.jsm" line: 160}]
[task 2020-09-07T17:41:47.995Z] 17:41:47 INFO - UnknownCollectionError@resource://services-settings/RemoteSettingsClient.jsm:160:5
[task 2020-09-07T17:41:47.995Z] 17:41:47 INFO - sync@resource://services-settings/RemoteSettingsClient.jsm:470:13
[task 2020-09-07T17:41:47.995Z] 17:41:47 INFO -
[task 2020-09-07T17:41:47.995Z] 17:41:47 INFO - Buffered messages logged at 17:35:47
[task 2020-09-07T17:41:47.996Z] 17:41:47 INFO - Longer timeout required, waiting longer... Remaining timeouts: 3
[task 2020-09-07T17:41:47.996Z] 17:41:47 INFO - Buffered messages logged at 17:37:17
[task 2020-09-07T17:41:47.996Z] 17:41:47 INFO - Longer timeout required, waiting longer... Remaining timeouts: 2
[task 2020-09-07T17:41:47.997Z] 17:41:47 INFO - Buffered messages logged at 17:38:47
[task 2020-09-07T17:41:47.999Z] 17:41:47 INFO - Longer timeout required, waiting longer... Remaining timeouts: 1
[task 2020-09-07T17:41:48.000Z] 17:41:47 INFO - Buffered messages logged at 17:39:42
[task 2020-09-07T17:41:48.000Z] 17:41:48 INFO - Console message: [JavaScript Error: "1599500382645 addons.xpi ERROR System addon update list error Error: got node name: html, expected: updates" {file: "resource://gre/modules/Log.jsm" line: 723}]
[task 2020-09-07T17:41:48.000Z] 17:41:48 INFO - append@resource://gre/modules/Log.jsm:723:12
[task 2020-09-07T17:41:48.000Z] 17:41:48 INFO - log@resource://gre/modules/Log.jsm:379:16
[task 2020-09-07T17:41:48.000Z] 17:41:48 INFO - error@resource://gre/modules/Log.jsm:387:10
[task 2020-09-07T17:41:48.001Z] 17:41:48 INFO - updateSystemAddons/res<@resource://gre/modules/addons/XPIInstall.jsm:4015:25
[task 2020-09-07T17:41:48.001Z] 17:41:48 INFO -
[task 2020-09-07T17:41:48.001Z] 17:41:48 INFO - Buffered messages finished
[task 2020-09-07T17:41:48.004Z] 17:41:48 INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_devtools_network_targetSwitch.js | Test timed out -

Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bdaeac93576e Read resourceType from resource instead of onResource*** functions. r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/1859923769f0 Read targetFront from resource instead of onResource*** functions. r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/834abe70ee6f Pass list of resources instead of unique resource from ResourceWatcher. r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: