handlebars.js 1.3.0 ~vs~ mustache.js rawgithub

JavaScript performance comparison

Revision 2 of this test case created by tomByrer

Info

Performance comparison between Handlebars and Mustache. Neither file is minified, & template is small.

Preparation code

<script>
var root = window;
</script>
<script src="https://rawgithub.com/janl/mustache.js/master/mustache.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.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

Test runner

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

Java applet disabled.

Testing in unknown unknown
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. Here’s a list of current revisions for this page:

0 comments

Add a comment