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
Testing multiple types of DOM queries against each other
<div id="parent_element">
<div class="salt myClass pepper">
</div>
<div class="salt myClass pepper">
<div class="salt myClass pepper">
<div id="mySelectId"></div>
</div>
</div>
</div>
<div id="second_element">
<div class="salt myClass pepper">
</div>
</div>
var p = document.getElementById("parent_element");
var c = ".myClass";
var id = "#mySelectId";
var e;
Ready to run.
Test | Ops/sec | |
---|---|---|
getElementById |
| ready |
getElementsByClassName |
| ready |
querySelectorAll |
| ready |
querySelector |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.