I have no comments on concatenation itself, but I would like to point out that @Jakub Hampl's suggestion:
To build strings in the DOM, in some cases it would be better to iteratively add the DOM and then add a huge string right away.
incorrect because it is based on an error test. This test is never added to the DOM.
This fixed test shows that creating a line immediately before rendering is much, MUCH faster. This is not even a competition.
(Sorry, this is a separate answer, but so far I do not have enough answers to comment on the answers.)
zAlbee Dec 15 '13 at 5:55 a.m. 2013-12-15 05:55
source share