Closed Bug 1902224 Opened 3 months ago Closed 3 months ago

Do not store JS traces in ResourceCommand cache

Categories

(DevTools :: Debugger, enhancement)

enhancement

Tracking

(firefox129 fixed)

RESOLVED FIXED
129 Branch
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).

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: nobody → poirot.alex
Status: NEW → ASSIGNED
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/848b4bddaa16
[devtools] Avoid caching traces in ResourceCommand cache. r=devtools-reviewers,nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: