Re:Two techniques for massively faster JavaScript
by briansmith on Monday April 27, 2009 @10:25AM
(#581373)
Try DocumentFragment instead:
http://ejohn.org/blog/dom-documentfragments/ http://slayeroffice.com/articles/innerHTML_alternatives/#5c
That said, constructing HTML as a string and using one innerHTML call is much faster than doing createNode/appendChild multiple times. DOM operations are definitely the bottleneck when it comes to performance : The less of them you do, the better off you are. (I learnt my lesson the hard way)