If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

two performance improvements to TBPL's HTML generation

RESOLVED FIXED

Status

Tree Management Graveyard
TBPL
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({perf})

Details

Attachments

(2 attachments)

I started poking at what was slow about TBPL, and found two relatively straightforward improvements.
Created attachment 463596 [details] [diff] [review]
set innerHTML only once

This avoids doing += on ul.innerHTML.  Doing innerHTML += ... means that we have to run the innerHTML getter, and then run the setter.  This saves serialization and reparsing.

This drops _writePushesListHTML from about 250ms to 180ms on current mozilla-central on my machine.
Attachment #463596 - Flags: review?(mstange)
Created attachment 463598 [details] [diff] [review]
use event handler attributes for machineResult links

Most of the time in _buildPushesList, however, is installing (and, for refreshes, uninstalling) the click handlers on the machineResult links.

This switches them to use event handler attributes.  It's a little out-of-style, but the win is huge.

This speeds up _buildPushesList from 425ms to 215ms for the initial load of current mozilla-central, and even more for the reloads (because of the uninstall).

After this patch, _writePushesListHTML dominates the performance of _buildPushesList.
Attachment #463598 - Flags: review?(mstange)
Comment on attachment 463596 [details] [diff] [review]
set innerHTML only once

Stepping on mstange's toes here...
Attachment #463596 - Flags: review?(mstange) → review+
Comment on attachment 463598 [details] [diff] [review]
use event handler attributes for machineResult links

This looks safe to me, but I'll let Markus take a look at it as well.

BTW, have you filed core bug to speed this up?
Attachment #463598 - Flags: review?(mstange) → review+
http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/bff03fb25158
http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/330ad3458ff3


sayrer suggested jQuery bind is slow; I'm not sure what core bug I would file.
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
And added a whitespace fix since I forgot the bug number:
http://hg.mozilla.org/users/mstange_themasta.com/tinderboxpushlog/rev/9ba0f98dd820
deployed
Blocks: 582851
Product: Webtools → Tree Management
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.