blakeembrey / dombars

*DEPRECATED* DOM-based templating library with data-binding and built on Handlebars
MIT License
51 stars 5 forks source link

Performance vs Strings #23

Closed KoryNunn closed 10 years ago

KoryNunn commented 10 years ago

I'm quite interested in how much faster than string manipulation and HTML parsing this will be than normal handlebars. I'd love to see a jsperf.com of the two.

blakeembrey commented 10 years ago

Are we talking compilation time? Or render speed? I will definitely add some tests, will be interesting to see the difference.

KoryNunn commented 10 years ago

Anything you can think of.

I got big improvements in a project by not creating any HTML for the browser to have to parse, instead only creating DOM nodes and updating textContent, so I would assume the same would have an even more profound effect here.

blakeembrey commented 10 years ago

@KoryNunn Interestingly I get about the same performance at the moment with appending a string and a precompiled template (very simple though, only one element). I think it could be improved slightly by removing some redundant function calls (keeping count of possible subscriptions, optimise element children, etc.), but that's still a little while away for me.

The main performance gains would be with attribute, tag name, string, etc. binding - any ideas on how to demonstrate this accurately?

blakeembrey commented 10 years ago

@KoryNunn Adding more elements bring it down against writing a string directly to innerHTML, so I might try to optimise some of the code when I get a chance. There is a lot of simple things I can do that, I think, will improve the overall speed (of rendering at least).