Network requests in background tabs where devtools is open jank the parent process main thread
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(firefox144 fixed)
Tracking | Status | |
---|---|---|
firefox144 | --- | fixed |
People
(Reporter: florian, Assigned: ochameau)
References
Details
(Keywords: perf:resource-use, perf:responsiveness)
Attachments
(1 file)
What were you doing?
Please tell us what site you were on, and what steps led to the error you are reporting
- Open 2 tabs with code in them that does an XHR every 5 seconds.
- Open devtools in each of them. I think I had one with the network tab selected, and the other one with the console selected.
- Open a third tab, put it in the foreground.
- Capture a profile to see what's happening.
What happened?
https://share.firefox.dev/3wFKKSo showing:
- almost 1s of CPU time used on the parent process main thread every 5 seconds
- Sync layout flush at https://searchfox.org/mozilla-central/rev/e65d93ace2a618b58bf1497c5be8918404f6dbbe/devtools/client/netmonitor/src/components/request-list/RequestListHeader.js#548
- jank multiple times
- opacity animations on scrollbars.
What should have happened?
No jank, no significant graphics activity for devtools in background tabs.
Do you have extensions installed?
CORS Everywhere was installed. I don't think it plays a role here.
Comment 1•1 year ago
|
||
Thanks for the report Florian. Did this happen immediately, or did you have to wait for several hours/days before the jank started?
Updated•1 year ago
|
Reporter | ||
Comment 2•1 year ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #1)
Thanks for the report Florian. Did this happen immediately, or did you have to wait for several hours/days before the jank started?
There were already a few thousand network requests in each tab, so probably at least a few hours.
Comment 3•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Netmonitor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 4•8 months ago
|
||
By removing the call to React forceUpdate
, bug 1943364 may help speedup this scenario.
Comment 5•8 months ago
|
||
One thing to consider here is that in this scenario we don't really toggle the visibility of an existing panel, so forceUpdate
was probably not applied. We basically have 3 tabs:
- two in the background:
- one with devtools open on the console, on a page which does many requests, and a hidden netmonitor
- another one with devtools open on the netmonitor, on the same page
- another foreground tab, on another page
And in this scenario, visibility handler will not detect that the panel is "hidden" because the owner tab is in the background. It's only triggered if the selected devtools panel changes. But maybe other improvements made recently will help. Testing on a recent central seems to show improvement compared to a 3 days old nightly.
Assignee | ||
Comment 6•2 months ago
|
||
Start using docShellIsActive
on toolbox's <browser> element.
This attribute controls the document.visibilityState
attribute
which is used by DevTools panels to stop doing React updates when a panel is hidden.
We synchronize docShellIsActive
value with the debugged's tab <browser> element.
Unfortunately, this attribute can only be used on top level <browser> elements,
so that we can't use it against DevTools panels which used nested <xul:iframe>.
We have to keep the workaround in setIframeVisible
, while acknowledging
the toolbox's visibility which can now be hidden.
Updated•2 months ago
|
Comment 8•1 month ago
|
||
bugherder |
Updated•16 days ago
|
Description
•