coll.index(elem) vs. elem.index()

Benchmark created by Simon Harte on


Preparation HTML

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

Setup

var $list = $('li'),
        $elem = $($list.get(1));

Test runner

Ready to run.

Testing in
TestOps/sec
coll.index(elem)
$list.index($elem);
ready
elem.index()
$elem.index();
ready

Revisions

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

  • Revision 1: published by Simon Harte on