Optimize transformResource in console frontend
Categories
(DevTools :: Console, 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
Reporter | ||
Comment 1•8 months ago
|
||
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.
Reporter | ||
Comment 2•8 months ago
|
||
DAMP results when applied on top of bug 1902229:
https://treeherder.mozilla.org/perfherder/comparesubtest?originalProject=try&newProject=try&newRevision=8dd116bc2e219914c0a1bd6df3ba641addacfa9c&originalSignature=4763542&newSignature=4763542&framework=12&application=firefox&originalRevision=a8bffd7a52e48a7ec74d7d666064369dc29040c5&page=1&showOnlyConfident=1
Description
•