Parent/find vs. next (v2)

Revision 2 of this benchmark created by epic on


Preparation HTML

<div id="test">
<ul>
<li class="red">Red</li>
<li class="blue">Blue</li>
<li class="green">Green</li>
<li class="yellow">Yellow</li>
<li class="orange">Orange</li>
</ul>
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Parent/find
var $parent = $("#test");
$parent.find("ul li.green");
$parent.find("ul li.yellow");
$parent.find("ul li.orange");
ready
Next
var $red = $("#test ul li.red");
var $green = $red.next("li.green");
var $yellow = $green.next("li.yellow");
$yellow.next("li.orange");
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.