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
Here's why:
Recursing the entire DOM for a very accessible element is stupid and holds a clear speed disadvantage.
<p class="noise"><span>noise</span>
<p class="noise"><span>noise</span>
<p class="noise"><span>noise</span>
<div class="noise">
<p class="noise"><span>noise</span></p>
<table class="findme" id="foo">
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</tbody>
</table>
<p class="noise"><span>noise</span></p>
</div>
<p class="noise"><span>noise</span></p>
<p class="noise"><span>noise</span></p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
POJS |
| ready |
jQuery (via id) |
| ready |
jQuery (via class) |
| ready |
jQuery "Optimized" |
| ready |
Hybrid |
| ready |
QS + QSA |
| ready |
QSA (by ID) |
| ready |
QSA (by class) |
| ready |
getElementById + QSA |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.