3 ms·
Could the difference be mostly due to handlebars vs. underscore? I'd be curious how it'd look normalizing for templating engine.
by rgarcia 15y ago
Could the difference be mostly due to handlebars vs. underscore? I'd be curious how it'd look normalizing for templating engine.
- braddunbar 15y agoAt first glance it seems that template rendering is a key point here (render-as-a-string vs. dom-manipulation). However, if you change the backbone implementation to use dom manipulation (http://jsfiddle.net/jqSK2/ http://jsfiddle.net/jqSK2/) it performs just as well (or better, depending on the browser). Backbone's event system is much more important in this comparison.
- wycats 15y agoI've been looking at the profiler (both Chrome and Safari) a bunch and it is emphatically not an issue with handlebars template. A number of things show up, but templates don't really show up as a major factor at all. There are a number of separate issues that bubbled up in the profile that I'm looking at. At least one seems like it may be a bug (but I may just be looking at it wrong), and the rest seem like cases where we can reduce the overall overhead of the binding system (as well as overhead in the view layer).