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
From http://elv1s.ru/files/html+css/removeChildren.html
Note: This test is incorrect. After the first test empties element
, it is not restored again, so obviously all tests after that will be über fast. See revision 3 for a fair version of this test.
<script>
var element = window.element = document.createElement("div");
var i = 2000;
while (i--) {
var p = document.createElement("p")
var j = 5;
while (j--) {
var span = document.createElement("span")
span.appendChild(document.createTextNode(i * j + "yada-yada"))
p.appendChild(span)
}
element.appendChild(p)
}
document.body.appendChild(element)
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML |
| ready |
textContent |
| ready |
removeFirstChild |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.