Agree only with GregL. The original test does not take into account the time taken to ultimately add the displayed html to the page.
You can also check out http://jsperf.com/dom-vs-innerhtml-based-templating/259
This test will include adding the displayed html text to the page.
You can compare it with http://jsperf.com/dom-vs-innerhtml-based-templating/257
Original test case. You will learn that the difference between template engines is not that important. You need to learn more about the usability of the template engine if you are not going to just display a patch of html text without putting it in a client browser.
In addition, in my opinion, a good template engine should help you maintain templates, help you write less, do more, which is also a jQuery principle.
doT.js is really good at performance, but I do not agree that it can help you code effectively.
Now I'm working on an open source project to try to create an easy-to-use template engine. It can help you manage your templates in a tree structure, create a link to a template, define your own syntax, bind data with html dom .. please try
http://jspopisno1.github.com/Beard
You can also read another question on stackoverflow
https://stackoverflow.com/questions/552934/what-javascript-templating-engine-do-you-recommend/8129492#8129492
source share