Open Bug 1902226 Opened 3 months ago Updated 3 months ago

Optimize transformResource in console frontend

Categories

(DevTools :: Console, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: ochameau, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

transformResource is a very hot codepath. It is called for every single item shown in the console.
So it ought to be very optimized.
First, the resource types should be ordered by their typical popularity in the console.
Trace should be first and console message should follow.
Then, the resource type should be read only once, outside of the scope of this function.

Doing things brings various speedups, and a notable 3% improvement on tracer ui rendering:
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=7cbfae91ca2cf807029abe222fa323cf32ef0a23&originalSignature=4763542&newSignature=4763542&framework=12&application=firefox&originalRevision=fd34e51719ee92a2b360458a0814ca84afc0faa0&page=1&showOnlyConfident=1

Blocks: js-tracer

Accessing to Resources.TYPES.* on each resource ended up slowing things down as this method is a hot codepath.
Also order the resource types by their "popularity", so that we aren't doing too many useless checks.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: