4 ms·
Javascript template engine performance vs language usability
Looking for template engines for client-side rendering I found this performance comparative:
http://jsperf.com/dom-vs-innerhtml-based-templating/73
On my machine
doT.js throws 2,741,665 ops/sec
haml.js throws 87,281 ops/sec
jade.js throws 13,298 ops/sec
I like the syntax of haml.js and I love the syntax of jade.js, but I loathe the syntax of doT.js and the others compared there
Why is that the performance of doT.js is ORDERS of magnitude faster than that of haml and jade?
Could it be possible to make haml and jade at least as performant as doT.js ?
I guess it is a matter of optimizing the parser...
- drKarl 15y agoI've found Skim (https://github.com/jfirebaugh/skim https://github.com/jfirebaugh/skim) which is a version of Slim designed to have embedded coffescript instead of embedded Ruby, and compiles to Javascript Templates. Nice, but I see that it still requires Ruby. I'd like to see a language agnostic client-side implementation (Well, javascript or coffescript implementation). I've used haml-js and it is nice...