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.
<style>
.destination {display: none;}
</style>
<div id="destination" class="destination"></div>
<script>
var content = '<div class="test"><span style="color: red">Wooo Text!</span></div><div>More text!</div>';
var dest = document.getElementById("destination");
var div = document.createElement('div');
dest.appendChild(div);
// 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]);
}
var doc = document;
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| innerHTML | | ready |
| cloneNode | | ready |
| DocumentFragment | | ready |
| DOM post insert | | ready |
| DOM pre insert | | ready |
| DOM post insert in jsland | | ready |
| cloneNode jsland | | ready |
| DOM pre insert jsland | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.