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
The different ways to select (context, pure selector, +find()) DOM elements using jQuery in parent/child scenarios.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div class="parentDivCls">
<div id="child01Div">
<span>
<ul>
<li>This is the first item <a href="#">I am an anchor</a></li>
<li>This is a parent<div>I am a child</div><div>I am a sibling</div></li>
<li>I am a sibling</li>
</ul>
</span>
<div>I'm the next and closest div.</div>
</div>
<span id="spTarget" class="spTargetCls" role="roleTarget">I'm a span<input id ="hdInput" type="hidden" />
</span>
<div id="nextDiv" >I'm the next div</div>
</div>
<div class="test">
</div>
<script>
var list = document.getElementById('child01Div');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
siblings |
| ready |
parent |
| ready |
prev |
| ready |
find |
| ready |
selector and find |
| ready |
parent/child selector |
| ready |
immediate children |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.