JQuery Tree Traversing (v9)

Revision 9 of this benchmark created by vladimir77 on


Description

testing the traversing functions of the JQuery engine

Preparation HTML

<div>
<div>
<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>I'm a span</span>
<div>I'm the next div</div>
</div>

<script src="http://code.jquery.com/jquery-1.8.3.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
children()
var a = $('li').children('div');
ready
closest()
var a = $('li').closest('div');
ready
find()
var a = $('li').find('div');
ready
next()
var a = $('li').next('div');
ready
nextAll()
var a = $('li').nextAll('div');
ready
offsetParent()
var a = $('li').offsetParent('div');
ready
parent()
var a = $('li').parent('div');
ready
parentsUntil()
var a = $('li').parentsUntil('span');
ready
prev()
var a = $('div').prev('span');
ready
prevAll()
var a = $('div').prevAll('span');
ready
sibling()
var a = $('div').siblings('div');
ready

Revisions

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