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
Checks whether scoped queryselectors are faster than document queryselectors
function button(text) {
const d = document.createElement("button");
d.textContent = text;
return d;
}
function span(children) {
const d = document.createElement("span");
d.append(...children);
return d;
}
for (let i = 0; i < 1000; i++) {
document.body.append(span([button('1'), button('1')]));
}
document.body.querySelectorAll('span').forEach((e) => e.remove());
Ready to run.
Test | Ops/sec | |
---|---|---|
Document querySelector |
| ready |
Queryselector inside first span |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.