children VS childNodes (v2)

Revision 2 of this benchmark created on


Preparation HTML

<ul>
<li>element 1</li>
<li>element 2</li>
<li>element 3</li>
<li>element 4</li>
<li>element 5</li>
<li>element 6</li>
<li>element 7</li>
<li>element 8</li>
<li>element 9</li>
<li>element 10</li>
</ul>

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

Test runner

Ready to run.

Testing in
TestOps/sec
children
for(i=0;i<10;i++)$('ul').get(0).children[i].innerHTML;
ready
childNodes
for(i=0;i<10;i++)e=$('ul').get(0).childNodes[i].innerHTML;
ready
children()
for(i=0;i<10;i++)e=$('ul').children().get(i).innerHTML;
ready

Revisions

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