Y.substitute vs gallery-mustache (v2)

Revision 2 of this benchmark created by Ryan Grove on


Preparation HTML

<script src="//yui.yahooapis.com/3.3.0/build/yui/yui.js"></script>
<script>
  Y = YUI({
   modules: {
    'gallery-mustache': {
     fullpath: 'https://github.com/derek/yui3-gallery/raw/master/build/gallery-mustache/gallery-mustache.js'
    }
   }
  }).use('gallery-mustache', 'substitute');
  
  
  var templateA = "Hello {{world}}, Hello {{world}}, Hello {{world}}";
  var viewA = {
   world: "World"
  }
  
  var templateB = "{{title}} spends {{calc}}";
  var viewB = {
   title: "Joe",
   calc: function() {
    return 2 + 4;
   }
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
gallery-mustache - property
Y.mustache(templateA, viewA);
ready
Y.substitute - property
Y.substitute(templateA, viewA);
ready
Y.mustache - method
Y.mustache(templateB, viewB);
ready
Y.substitute - method
Y.substitute(templateB, viewB);
ready
Y.Lang.sub - property
Y.Lang.sub(templateA, viewA);
ready

Revisions

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

  • Revision 1: published by Derek Gathright on
  • Revision 2: published by Ryan Grove on