@Josh Powell
- string concatenation is plenty fast 99% of the time and a lot more
readable.
Yes string concatenation is more readable and 99% faster for normal
usage. But looping and concatenate a huge chunk in this particular
case is slower. Reason: every + between 2 strings returns a new string
before concatenating with other strings. Array.prototype.join does not
have that problem. You just need more than 6 string concatenation
(subject to string length and debate) and it will be a good choice for
Array.prototype.join to take over.

- W3C DOM Node creation is much slower then inserting via innerHTML,
especially as you add more nodes.  It doesn't matter how fast the
nodes are created, it will always be slower to create, adjust, and
insert 10,000 nodes then one string.
That's old school thinking. Please refer to my original post, I am
talking about Chrome's v8 engine and browser detection. You will be
pleasantly surprised. See RobG's comment too.

@RobG
Thanks for benchmarking.

Reply via email to