Handlebars vs Coffee-Templates

Benchmark created by Mike Smullin on


Description

benching my minimalist alternative to the official lib

Preparation HTML

<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script>
<script src="https://raw.github.com/mikesmullin/coffee-templates/production/js/coffee-templates.js"></script>

Setup

var template   = '<ul class="people_list">\n{{#each people}}\n<li>{{this}}</li>\n{{/each}}\n</ul>';
    
    var data = {
      people: ["Yehuda Katz", "Alan Johnson", "Charles Jolley"]
    };
    
    window.each = function(o, cb) {
      var k;
      for (k in o) {
        cb.apply(o[k], [k, o[k]]);
      }
    };

Test runner

Ready to run.

Testing in
TestOps/sec
Handlebars
Handlebars.compile(template)(data);
 
ready
Coffee-Templates
CoffeeTemplates.compile(template)(data);
ready

Revisions

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