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
Tests various DOM construction patterns.
<div id="destination"></div>
<script>
var content = '<div class="test"><span style="color: red">Wooo Text!</span></div><div>More text!</div>',
dest = document.getElementById("destination");
// For Element cloneNode test
var womb = document.createElement("div");
womb.innerHTML = content;
// For doc fragment test
var frag = document.createDocumentFragment(),
clone = womb.cloneNode(true),
len = clone.childNodes.length;
while (len--) {
frag.appendChild(clone.childNodes[0]);
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
innerHTML |
| ready |
cloneNode |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.