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
<div id="sandbox"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.3.0/lodash.js"></script>
Benchmark.prototype.setup = function() {
var $sandbox = $('#sandbox'),
data = [{name:"test1"}, {name:"cheese"}, {name: "another"}],
template = _.template('<li>Motherfucking <%= name %>!</li>'),
singleTpl = _.template('<ul>\
<% _.forEach(data, function(item) { %>\
<li>Motherfucking<%- name %>!</li>\
<% }); %>\
</ul>');
$('#sandbox').empty()
}
};
Benchmark.prototype.teardown = function() {
$('#sandbox').empty()
Ready to run.
Test | Ops/sec | |
---|---|---|
jQuery re-append loop (bad) |
| ready |
Insert array of html strings |
| ready |
Insert fragment of nodes |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.