Latest handlebars.js vs latest mustache.js

JavaScript performance comparison

Revision 3 of this test case created by

Preparation code

<script>
var root = window;
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-v1.2.1.js"></script>
      
<script>
Benchmark.prototype.setup = function() {
  var template = 'Hello {{name}}! You have {{mailCount}} new e-mails. Go back to {{page}}';
  
  var data = { name: 'Eneko', mailCount: 5, page: 'Main page' };
  
  // Preparse
  Mustache.parse(template);
  
  // Precompile
  var compiledHbs = Handlebars.compile(template);

};
</script>

Preparation code output

<script src="https://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.js"></script> <script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-v1.2.1.js"></script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Mustache
Mustache.render(template, data);
pending…
Handlebars
compiledHbs(data);
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.

0 Comments