Template Hogan.js comparison
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.4/mootools-yui-compressed.js"></script><script src="https://raw.github.com/tbela99/template/master/Source/Template.js"></script><script src="https://raw.github.com/janl/mustache.js/master/mustache.js"></script><script src="https://raw.github.com/twitter/hogan.js/master/lib/template.js"></script>
<script src="https://raw.github.com/twitter/hogan.js/master/lib/compiler.js"></script>
<script>
Benchmark.prototype.setup = function() {
var template = new Template();
var tmpl = '{repeat:mustache} {name}{.}{/repeat:mustache}',
render = template.compile(tmpl),
data = {mustache: [1, 2, 3, 4]}
compiled = Hogan.compile("{{#mustache}} {{name}}{{.}}{{/mustache}}");
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Mustache |
|
pending… |
Hogan |
|
pending… |
precompiled Template |
|
pending… |
Template |
|
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 Thierry Bela
- Revision 2: published
- Revision 3: published by Thierry Bela
- Revision 4: published
- Revision 5: published by Thierry Bela
- Revision 6: published by Rolf
- Revision 7: published by Thierry Bela
- Revision 8: published by Thierry Bela
0 comments