Closed Bug 1756822 Opened 3 years ago Closed 3 years ago

Reduce time spent in resources/console-messages onConsoleAPICall

Categories

(DevTools :: Console, task)

task

Tracking

(firefox99 fixed)

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-console-perf-2022)

Attachments

(1 file)

In this profile: https://share.firefox.dev/3IfaCVP
logging 10000 objects, there's a lot of time spent in onConsoleAPICall
There's the direct cost of prepareConsoleMessageForRemote, which takes a message and turn it into an object, but also the cost of sending the resource through JSWindowActor to the parent process (that cost is also visible in parent process where we receive the packets).

JSWindowActor seems to use structuredClone on the packet, so reducing the amount of data we send might speed up things.
It would be nice to do a review of the different properties to see if they are useful
We can also probably not include some properties that don't make sense when they're null/false (e.g. groupId, counter, ...)

Whiteboard: dt-console-perf-2022

Don't clone the whole message we receive as a result of a console API call, but select
properties that are being used on the client.
As a result, we're not sending some properties anymore (functionName, addonId, workerType),
and we also don't include some properties when they are falsy and wouldn't bring
any benefit (counter,timer, private, prefix, stacktrace)

Hopefully this helps save some cycle since we're not cloning an object, but also in the
JSActor communication since the packet we need to send is smaller.

Depends on D139570

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2057064f7907 [devtools] Don't include unnecessary properties in console message resource. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Blocks: 1760590
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: