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
<style type="text/css">
#canvas {
position:absolute;
left: -1000px;
}
</style>
<div id="css"></div>
<div id="canvas"></div>
function makeHtml(rows) {
var html = '<div class=".extra"></div><div class="a"><div class="b"><div class="c"><div class="d"><div class="e">';
for (var i = 0; i < rows; i++) {
html += '<div class="r0"><div id="r1"><div class="r2"><div class="r3"><div class="r4">' +
'test</div></div></div></div></div>';
}
html += '</div></div></div></div></div>';
return html;
}
document.getElementById('canvas').innerHTML = '';
document.getElementById('css').innerHTML = '';
function run(rows, css) {
var canvas = document.getElementById('canvas');
var style = document.getElementById('css');
canvas.innerHTML = makeHtml(rows);
style.innerHTML = '<style type="text/css">' + css + '</style>';
return canvas.offsetHeight;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
.class 10000 |
| ready |
div.class 10000 |
| ready |
#id 10000 |
| ready |
div#id 10000 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.