olado/doT — Issue #14: Consider using array concatenation to speed up older browsers
Author: lorian69
Created: 2011-11-21 19:09:43+00:00
State: open

I've found that I can get a substantial speed increase on older browsers such as IE7 by using array concatenation in the output template function instead of string concatenation. In one instance, it decreased the render time from upwards of 60 seconds to around 4 seconds on IE7 (all other browsers were essentially instant). Changing the output function to use arrays did not seem to have an adverse effect on the newer browsers either, but it could easily be made into a configuration option.

Use:
var out = []; out.push(...);

Rather than:
var out = ''; out += '...';