Jarty vs Mustache vs Handlebars

Benchmark created by yonekawa on


Preparation HTML

<script src="https://raw.github.com/kotas/jarty/master/src/jarty.js"></script>
<script src="https://raw.github.com/janl/mustache.js/master/mustache.js"></script>
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.4.js"></script>

<script type="text/javascript">
  var jar = '{foreach from=$items item=item}<div>{$item|escape}</div>{/foreach}';
  var mus = '{{#items}}<div>{{.}}</div>{{/items}}';
  var data = {items:['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']};
  var comp = Handlebars.compile(mus);
  var jcomp = Jarty.compile(jar);
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Jarty
contents = Jarty.eval(jar, data)
ready
Mustache
contents = Mustache.to_html(mus, data);
ready
Handlebars
template = Handlebars.compile(mus);
contents = template(data);
 
ready
Handlebars(Compiled)
contents = comp(data);
 
ready
Jarty(Compiled)
contents = jcomp(data);
console.log(contents);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by yonekawa on