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
Benchmarking difference in performance of rendering simple Underscore template - classic vs. precompiled
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.2/lodash.min.js"></script>
<script>
var lodash = _.noConflict();
</script>
var _ = window.lodash;
var template = '<div class="item <%= id %>">' +
' <h1><%= title %></h1>' +
' <p><%= desc %></p>' +
' <ul class="attributes">' +
' <li><%= attrs.dimensions %></li>' +
' <li><%= attrs.weight %></li>' +
' <li><%= attrs.price %></li>' +
' </ul>' +
'</div>';
var templateFuncPrecompiled = eval("(" + _.template(template).source + ")");
function temp(id,title,desc,dimensions,weight,price){
var template = '<div class="item'+id+'">\
<h1>'+title+'</h1>\
<p>'+desc+'</p>\
<ul class="attributes">\
<li>'+dimensions+'</li>\
<li>'+weight+'</li>\
<li>'+price+'</li>\
</ul>\
</div>';
return template ;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
classic |
| ready |
precompiled |
| ready |
JS only |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.