Ressources could be better throttled to the client
Categories
(DevTools :: Framework, enhancement, P3)
Tracking
(firefox161 fixed)
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug, Regressed 1 open bug)
Details
Attachments
(1 external file)
The throttling logic used by the server codebase is imperfect.
We would typically notify the client about a single ressource because aggregating all the following ones.
That's because of this code:
https://searchfox.org/firefox-main/rev/98bf4b92d3f5d7a9855281df4bf333210bcfbbc4/devtools/shared/throttle.js#42-51
const remaining = wait - (now - previous);
args = arguments;
if (remaining <= 0) {
if (!isWorker) {
clearTimeout(timeout);
}
timeout = null;
previous = now;
result = func.apply(scope, args);
args = null;
Throttling would consider that an old call to the method justify calling the original method right away, whereas we should probably have a little bounce period to try to aggregate any (possibly synchronous) closely following call!
| Assignee | ||
Comment 1•7 months ago
|
||
The patch will introduce a new throttling mixing a first bouncing phase, to aggregate calls after a "calm period" followed by a throttling one.
While it fixes issues with some tests not resolving correctly because of ressources being notified in multiple throttled aggregates (like in bug 2023681), it is hard to guess from DAMP what could be a relevant setting for bouncing and throttling durations.
tl;dr; 10ms bounce 100ms throttle may be a good default?
Assuming a 100ms throttle (same as today)
Comparing between 10ms and 25ms bounce:
25ms regress console-log-in-content while it improved panels in background.
Comparing between 25 and 50ms bounce:
it looks like 50ms regress a few things while improving console-log-in-content ones.
Comparing between 10 and 0ms bounce)
Moving to 0 seems to regress a couple of reload test while improve random others
Comparing different throttlings
Comparing 100 to 200ms) regress performances (with a 0 bounce)
It also regresses from 100 to 200 with a 50ms bounce)
| Assignee | ||
Comment 2•7 months ago
|
||
This help aggregate the first ressources which may have dispatched
right away whereas some others could be delivered synchronously right after.
Updated•7 months ago
|
Comment 4•6 months ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:ochameau, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Updated•6 months ago
|
| Assignee | ||
Updated•23 days ago
|
Comment 6•22 days ago
|
||
| bugherder | ||
Updated•13 days ago
|
Description
•