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
Tests which jQuery selection method is fastest for getting a collection of HTML <ul> list elements. Note that if you have nested lists (i.e., <ul> <li> <ul> <li> </ul> </li> </ul> that only $('#list').children('li') will provide the correct number of child <li> elements for the first level. Using $('#list').children() appears to also include the second level <ul> element.
<ul id="list">
<li>first</li>
<li>second</li>
<li>tree</li>
<li>fo</li>
<li>fif</li>
</ul>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
Ready to run.
Test | Ops/sec | |
---|---|---|
id+children() |
| ready |
id+tag |
| ready |
id+children(tag) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.