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
Revision of 167. Fix error on Firefox.
<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;
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
removeChild Recheck |
| ready |
removeChild lastChild with reference |
| ready |
firstChild haschildnodes() check |
| ready |
deletecontents (IE9+) |
| ready |
replaceChild cloneNode(shallow) (DESTRUCTIVE) |
| ready |
removeChild then reAttach |
| ready |
innerhtml = "" |
| ready |
jquery |
| ready |
hide |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.