t-bench2
JavaScript performance comparison
Info
More complicated mustache
Preparation code
<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<script src="http://twitter.github.com/hogan.js/builds/1.0.3/hogan.js"></script>
<script src="http://github.com/janl/mustache.js/raw/master/mustache.js"></script>
<script>
Benchmark.prototype.setup = function() {
var template = "<strong>This is a slightly more complicated {{thing}}.</strong>.\n{{! Just ignore this business. }}\nCheck this out:\n{{#hasThings}}\n<ul>\n{{#things}}\n<li class={{className}}>{{word}}</li>\n{{/things}}</ul>.\n{{/hasThings}}\n{{^hasThings}}\n\n<small>Nothing to check out...</small>\n{{/hasThings}}";
var context = {
thing: function() {
return "blah";
},
things: [
{"className": "one", word: "@fat"},
{"className": "two", word: "@dhg"},
{"className": "three", word:"@sayrer"}
],
hasThings: true
};
var handlebarsRenderer = Handlebars.compile(template);
var hoganRenderer = Hogan.compile(template);
};
</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… |
Hogan |
|
pending… |
Mustache |
|
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 jacob and last updated
- Revision 6: published and last updated
- Revision 7: published and last updated
- Revision 8: published by ali: added closure soya template and last updated
- Revision 9: published
- Revision 10: published by Fedor Indutny
- Revision 11: published by Mario Estrada
- Revision 12: published by cfddream
0 comments