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
Comparing complex DOM traversal speed in jQuery via class names vs ids.
<div></div>
<div></div>
<div></div>
<div id="a" class="_a">
<div></div>
<div></div>
<div></div>
<div id="b" class="_b">
<div></div>
<div></div>
<div id="c" class="_c">
<div></div>
<span></span>
<span></span>
<span></span>
<span id="foo" class="_foo">Hello, World!</span>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
var el;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Tag-specific traversal by class name |
| ready |
Tag-specific traversal by id |
| ready |
Non-tag-specific traversal by id |
| ready |
Tag-specific singular id traversal |
| ready |
Non-tag-specific singular id traversal |
| ready |
descendant jquery.find by id |
| ready |
find classes |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.