Do not store JS traces in ResourceCommand cache
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox129 fixed)
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
The JavaScript Traces resources are currently expected to be listened by the webconsole panel before we start recording for traces.
This is the reason why, the console panel is shown as soon as we start recording traces.
This allows us to not depend on ResourceCommand cache in order to receive resources received before the panel is show and before the panel starts watching for trace resources.
Storing the traces in the ResourceCommand cache isn't only a cause of higher memory usage (the internal Map adds some more memory usage and may keep the objects allocation longer than expected).
But it is especially a performance issue. Recording that many entries in a Map ends up being very visible when profiling the tracer.
It would be neat to have a generic feature in ResourceCommand to consider some resource type as being "transient" and only observable "live".
i.e. only active resource listeners would receive such resources and not listeners registered in the future. Nor can they be returned by getAllResources(resourceType)
.
Assignee | ||
Comment 1•3 months ago
|
||
Doing this speeds up tracer UI by 5%
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=55342279952cb334b18fde456189cfba7c839c07&originalSignature=4763542&newSignature=4763542&framework=12&application=firefox&originalRevision=fd34e51719ee92a2b360458a0814ca84afc0faa0&page=1&showOnlyConfident=1
Assignee | ||
Updated•3 months ago
|
Assignee | ||
Comment 2•3 months ago
|
||
Another DAMP run, with this change after migrating the tracer to use individual resources (bug 1902229).
This cache issue start being really visible only once we do this migration.
Assignee | ||
Comment 3•3 months ago
|
||
We expect the console to be opened before toggling the tracing on the server side
and so, the ResourceCommand cache isn't useful, while it being costly with so many resources to cache.
Assignee | ||
Comment 4•3 months ago
|
||
DAMP with this patch on top of bug 1902229:
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=97ecbec98eb37e1332b2b03c19956aad6a99ceae&originalSignature=4763542&newSignature=4763542&framework=12&application=firefox&originalRevision=a8bffd7a52e48a7ec74d7d666064369dc29040c5&page=1&showOnlyConfident=1
5% improvement in tracer UI.
Updated•3 months ago
|
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/848b4bddaa16 [devtools] Avoid caching traces in ResourceCommand cache. r=devtools-reviewers,nchevobbe
Comment 6•3 months ago
|
||
bugherder |
Description
•