Closed Bug 585111 Opened 14 years ago Closed 14 years ago

two performance improvements to TBPL's HTML generation

Categories

(Tree Management Graveyard :: TBPL, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

References

Details

(Keywords: perf)

Attachments

(2 files)

I started poking at what was slow about TBPL, and found two relatively straightforward improvements.
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)
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
Closed: 14 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: