Handlebars vs Coffee-Templates
JavaScript performance comparison
Info
benching my minimalist alternative to the official lib
Preparation code
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script>
<script src="http://mikesmullin.github.com/coffee-templates/js/coffee-templates.js"></script>
<script>
Benchmark.prototype.setup = function() {
var template = '<ul class="people_list">\n{{#each people}}\n<li>{{this}}</li>\n{{/each}}\n</ul>';
var data = {
people: ["Yehuda Katz", "Alan Johnson", "Charles Jolley"]
};
window.each = function(o, cb) {
var k;
for (k in o) {
cb.apply(o[k], [k, o[k]]);
}
};
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Handlebars |
|
pending… |
Coffee-Templates |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by Mike Smullin
- Revision 2: published
- Revision 3: published
0 comments