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
Making the HTML tree more representative of cases where performance would matter, i.e. where there are more elements of the selected type, especially outside of the #id element.
Added test case #5, 'el el', where we remove one variable from the equation as compared to '#id el': the likelihood of a Sizzle optimization that applies when the select begins with #id
; and we remove another variable from the equation as compared to unrestricted 'el': the cost of "decorating" a collection of DOM nodes (which I take to mean, packaging them as jQuery objects).
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<span><div id="id"><span/></div></span>
<span/><span/><span/><span/>
<span>
<span/><span/><span/><span/>
<span/><span/><span/><span/>
<span>
<span/><span/><span/><span/>
<span/><span/><span/><span/>
</span>
</span>
Ready to run.
Test | Ops/sec | |
---|---|---|
#id el |
| ready |
el unrestricted |
| ready |
find |
| ready |
context |
| ready |
el el |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.