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
Test to determine the most efficient Javascript or jQuery selector. This test assumes you can manipulate the HTML to provide the id or class that is necessary hook for the most efficient selector.
<div id="alpha" class="alpha">Alpha</div>
<span id="bravo" class="bravo">Beta</span>
<div id="charlie" class="charlie">Charlie</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
getElementById | Vanilla JS |
| ready |
getElementsByTagName | Vanilla JS |
| ready |
getElementsByClassName from multiple | Vanilla JS |
| ready |
getElementsByClassName | Vanilla JS |
| ready |
querySelector | Vanilla JS |
| ready |
by id | jQuery |
| ready |
by tag name | jQuery |
| ready |
by tag name from multiple | jQuery |
| ready |
by class name | jQuery |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.