jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script src="http://sb.taurus.uberspace.de/jslib/jquery-1.7.1.min.js"></script>
<script src="http://sb.taurus.uberspace.de/jslib/jquery.mustache-0.5.0.min.js"></script>
<script src="http://sb.taurus.uberspace.de/jslib/handlebars.1.0.beta.5.js"></script>
<script src="http://raw.github.com/linkedin/dustjs/master/dist/dust-full-1.2.0.js"></script>
<script>
window.sharedVariables = {
header: "Header",
header2: "Header2",
header3: "Header3",
header4: "Header4",
header5: "Header5",
header6: "Header6",
list: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
};
window.mustacheTemplate = "<div><h1 class='header'>{{{header}}}</h1><h2 class='header2'>{{{header2}}}</h2><h3 class='header3'>{{{header3}}}</h3><h4 class='header4'>{{{header4}}}</h4><h5 class='header5'>{{{header5}}}</h5><h6 class='header6'>{{{header6}}}</h6><ul class='list'>{{#list}}<li class='item'>{{{.}}}</li>{{/list}}</ul></div>";
window.handlebarsTemplate = Handlebars.compile("<div><h1 class='header'>{{header}}</h1><h2 class='header2'>{{header2}}</h2><h3 class='header3'>{{header3}}</h3><h4 class='header4'>{{header4}}</h4><h5 class='header5'>{{header5}}</h5><h6 class='header6'>{{header6}}</h6><ul class='list'>{{#each list}}<li class='item'>{{this}}</li>{{/each}}</ul></div>");
Handlebars.template((function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.handlebarsTemplatePrecompiled=a(function(a,b,c,d,e){function p(a,b){var c="",d;return c+="<li class='item'>",d=a,typeof d===l?d=d.call(a,{hash:{}}):d===n&&(d=m.call(a,"this",{hash:{}})),c+=o(d)+"</li>",c}c=c||a.helpers;var f="",g,h,i,j,k=this,l="function",m=c.helperMissing,n=void 0,o=this.escapeExpression;f+="<div><h1 class='header'>",i=c.header,g=i||b.header,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header",{hash:{}})),f+=o(g)+"</h1><h2 class='header2'>",i=c.header2,g=i||b.header2,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header2",{hash:{}})),f+=o(g)+"</h2><h3 class='header3'>",i=c.header3,g=i||b.header3,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header3",{hash:{}})),f+=o(g)+"</h3><h4 class='header4'>",i=c.header4,g=i||b.header4,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header4",{hash:{}})),f+=o(g)+"</h4><h5 class='header5'>",i=c.header5,g=i||b.header5,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header5",{hash:{}})),f+=o(g)+"</h5><h6 class='header6'>",i=c.header6,g=i||b.header6,typeof g===l?g=g.call(b,{hash:{}}):g===n&&(g=m.call(b,"header6",{hash:{}})),f+=o(g)+"</h6><ul class='list'>",i=c.list,g=i||b.list,h=c.each,j=k.program(1,p,e),j.hash={},j.fn=j,j.inverse=k.noop,g=h.call(b,g,j);if(g||g===0)f+=g;return f+="</ul></div>\n",f})})());
window.dustTemplatePrecompiledCached = (function(){dust.register("dustTemplatePrecompiledCached",body_0);function body_0(chk,ctx){return chk.write("<div><h1 class='header'>").reference(ctx.get("header"),ctx,"h").write("</h1><h2 class='header2'>").reference(ctx.get("header2"),ctx,"h").write("</h2><h3 class='header3'>").reference(ctx.get("header3"),ctx,"h").write("</h3><h4 class='header4'>").reference(ctx.get("header4"),ctx,"h").write("</h4><h5 class='header5'>").reference(ctx.get("header5"),ctx,"h").write("</h5><h6 class='header6'>").reference(ctx.get("header6"),ctx,"h").write("</h6><ul class='list'>").section(ctx.get("list"),ctx,{"block":body_1},null).write("</ul></div>");}function body_1(chk,ctx){return chk.write("<li class='item'>").reference(ctx.getPath(true,[]),ctx,"h").write("</li>");}return body_0;})();
dust.loadSource(dustTemplatePrecompiledCached, "dustTemplatePrecompiledCached");
window.dustTemplate = function(content) {
dust.render("dustTemplatePrecompiledCached", content, function() {});
};
</script>
console.log(Handlebars);
Ready to run.
Test | Ops/sec | |
---|---|---|
mustache.js |
| ready |
handlebar.js |
| ready |
handlebar.js (precompiled) |
| ready |
linkedindust.js |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.