Closed Bug 1758638 Opened 4 years ago Closed 4 years ago

ConsoleAPIListener#isMessageRelevant could be faster

Categories

(DevTools :: Console, task)

task

Tracking

(firefox100 fixed)

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- 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/3hUWJAx , 3.5% of console.log is spent in isMessageRelevant.
Most of the time there is spent retrieving the innerWindowId of the instance window, which we can probably cache
The other part is spent in getWorkerType which may be sped up by not looking into the array of worker ids.

DAMP results aren't super obvious (perfherder), but this is not showing up in profile anymore.
Also, the content-process-bulklog test logs window/objects and most of the time is spent creating the grip, but I guess this patch would help more in places where we only log primitives.

Store the window innerWindowId instead of retrieving it for each message.
Refactor getWorkerType to not use Array method.

Depends on D140604

Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/14aa2e66826f [devtools] Speedup ConsoleAPIListener#isMessageRelevant. r=jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: