which is faster children() or find() (v3)

Revision 3 of this benchmark created on


Description

Testing which method is faster children() or find() on given DOM structure

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<ul id="test">
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
<li>item 4</li>
<li>item 5</li>
<li>item 6</li>
<li>item 7</li>
<li>item 8</li>
<li>item 9</li>
<li>item 10</li>
</ul>

Test runner

Ready to run.

Testing in
TestOps/sec
children()
$('#test').children();
ready
find() only children elements
$('#test').find('> *');
ready
specified children()
$('#test').children('li');
ready
find() li elements
$('#test').find('li');
ready

Revisions

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