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
not complete
<style>
.el {
width: 10px;
height: 10px;
border: 1px solid black;
box-shadow: 0 0 10px 1px grey;
}
</style>
<div id="parent"><div id="work" style="width:400px;height:400px;overflow: scroll;"></div></div>
parentEl = document.getElementById('parent');
work = document.getElementById('work');
childCount = 10;
for (var i = 0; i < 10; i++) {
parentEl.appendChild(gen());
}
function gen() {
var el = document.createElement('a'),
flag = Math.random() > 0.5;
el.className = 'el';
el.style.float = flag ? 'left' : 'right';
el.style.backgroundColor = flag ? 'red' : 'green';
el.style.marginTop = ~~ (Math.random() * 5) + 'px';
el.style.marginLeft = ~~ (Math.random() * 5) + 'px';
el.onclick = function() {
alert(123);
};
return el;
}
work.innerHTML = '';
for (var i = 0; i < 10; i++) {
work.appendChild(gen());
}
Ready to run.
Test | Ops/sec | |
---|---|---|
documentFragment |
| ready |
native |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.