travis-ci/travis-web — pull request #239 by gark87 (2014-01-04 18:56:02+00:00)
Title: Improve huge folds performance

Hi all,

##### Problem description
I've noticed that there is a performance problem in Firefox (both Windows and Linux) on pages like https://travis-ci.org/gark87/scalaz/builds/14647693.
As far as I understand, the reason is that modifying DOM (by _appendChild_) for every line in fold causes too many re-renderings.

##### Patch description
I've removed parent element before DOM modification, so its modification does not cause page re-rendering.
When all modifications are done parent element is put back.

##### Performance measurements
Using Firebug I've got the following statistics:
*Before: Profile (45300.839ms, 2053410 calls)*

Function	Calls	Percent	Own Time	Time	Avg	Min	Max	File

anonymous	12	72.4%	32799.981ms	37589.045ms	3132.42ms	0.191ms	34239.346ms
folds (line 28)

anonymous	13	2.36%	1069.513ms	1069.711ms	82.285ms	0.029ms	542.088ms
app.js (line 9504)

anonymous	22582	1%	451.817ms	451.817ms	0.02ms	0.015ms	0.137ms
renderer (line 94)

*After: Profile (17760.342ms, 1839324 calls)*

Function	Calls	Percent	Own Time	Time	Avg	Min	Max	File

anonymous	12	31.03%	5511.057ms	5518.998ms	459.917ms	0.16ms	3115.039ms
folds (line 28)

anonymous	33	10.24%	1818.61ms	1818.89ms	55.118ms	0.028ms	539.406ms
app.js (line 9504)

anonymous	22582	2.54%	450.867ms	450.867ms	0.02ms	0.015ms	0.119ms
renderer (line 94)