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
Rev 25 Notes: Fixed test 5 - context was backwards. Added test 7/8 to demonstrate performance of using getElementByID to grab the initial context. Also, this is not a real apples to apples test. Comparing just the main ID selector to filtering or more complex selectors are not equivalent performance metrics. Note the major difference between letting jQuery find the ID and letting the browser do it.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<div id="Mytbl">
<div id="MyElement"></div>
<div class="MyClass"></div>
</div>
Ready to run.
Test | Ops/sec | |
---|---|---|
Direct ID |
| ready |
Nested ID's |
| ready |
ID - Class |
| ready |
find() |
| ready |
Context |
| ready |
ID / Class with Tag |
| ready |
Direct ID getElementByID w/ jQuery |
| ready |
getElementByID as context |
| ready |
querySelector |
| ready |
ID querySelector w/ jQuery |
| ready |
getElementById vs. querySelector |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.