[meta] Migrate away from `listTabs` wherever possible

NEW
Unassigned

Status

()

Firefox
Developer Tools
P2
normal
10 months ago
6 months ago

People

(Reporter: jryans, Unassigned)

Tracking

({meta})

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 affected)

Details

(Reporter)

Description

10 months ago
The DevTools `listTabs` request is a very expensive operation, especially if there are many open tabs.  It will cause us to visit every tab, load a frame script, start a debugger server, and read some data.  With lazy tab support (bug 906076), this would trigger any lazy tabs to be loaded, greatly increasing resource usage.

In many cases, we don't really need `listTabs` anyway, it just happened to exist and was easy to use for many purposes.

If you need the global actors, use the new `getRoot` from bug 1352157.
If you need a single tab, use `getTab` instead.

There are a few places (WebIDE, about:debugging) where we try enumerate all tabs, so you can choose one for debugging.  For these cases, it would be better to create something more minimal that only uses whatever data is known about the tab from the parent process, so we can avoid most of the expense.
(Reporter)

Comment 1

10 months ago
Current usages[1]:

* about:debugging
* Connect page
* target.root (fixed in bug 1352157)
* Legacy performance front
* WebIDE
* Various tests

[1]: http://searchfox.org/mozilla-central/search?q=listTabs(&case=true&path=
(Reporter)

Updated

10 months ago
Depends on: 1354614
Since the dependencies are now fixed, is this bug now done or do more bugs need to be filed? This is the last bug blocking bug lazytabs, which blocks bug photon-performance.
(Reporter)

Comment 3

9 months ago
(In reply to Panos Astithas [:past] (please needinfo?) from comment #2)
> Since the dependencies are now fixed, is this bug now done or do more bugs
> need to be filed? This is the last bug blocking bug lazytabs, which blocks
> bug photon-performance.

I don't think this needs to block lazytabs.  I believe only bug 1352157 was important regular usage, and that's fixed now.
No longer blocks: 906076
(Reporter)

Comment 4

9 months ago
(Yes, there are more bugs to be filed, most items in comment 1 haven't been done yet.)
You need to log in before you can comment on or make changes to this bug.