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="box"></div>
<script>
var boxAnchor, box, i, b, range;
boxAnchor = document.createElement('div');
boxAnchor.style.cssText="white-space:nowrap";
boxAnchor.id = 'box';
for (i = 0; i < 1000; i++) {
b = document.createElement('B');
b.appendChild(document.createTextNode('asdf fewf'));
boxAnchor.appendChild(b);
}
box = document.getElementById('box');
// Clone boxAnchor to box
function refreshRange() {
var newBox = boxAnchor.cloneNode(true);
box.parentNode.replaceChild(newBox, box);
box = newBox;
}
var range = document.createRange();
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
refreshRange();
Ready to run.
Test | Ops/sec | |
---|---|---|
innerhtml = "" |
| ready |
removeChild then reAttach |
| ready |
replaceChild cloneNode(shallow) (DESTRUCTIVE) |
| ready |
hide |
| ready |
removeChild Recheck |
| ready |
jquery |
| ready |
firstChild haschildnodes() check |
| ready |
deletecontents (IE9+) |
| ready |
removeChild lastChild with reference |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.