Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
String concatenation can be surprisingly performance intensive. It’s a common task to build a string by continually adding to the end of it in a loop (e.g., when building up an HTML table or an XML document), but this sort of processing is notorious for its poor performance in some browsers.
So how can you optimize these kinds of tasks? For starters, there is more than one way to merge strings (see Table 5-1).