jQuery nextAll vs siblings (v9)

Revision 9 of this benchmark created on


Description

jQuery's next/prev vs using the slibings('selector')

Preparation HTML

<div id="parent">
        <div class="child"></div>
        <div class="sibling"></div>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>

Setup

var child = $('#parent').find('.child');

Test runner

Ready to run.

Testing in
TestOps/sec
next
var next = child.nextAll();
ready
siblings
var sibling = child.siblings();
ready
parent.children
var sibling = child.parent().children('.sibling')
 
ready

Revisions

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