\:first vs eq

Benchmark created by xiaohao on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="a">
  <div class="b"></div>
  <div class="b"></div>
  <div class="b"></div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
:first
$('.b:first')
ready
$('.b').eq(0)
$('.b').eq(0)
ready
$('.b:eq(0)')
$('.b:eq(0)')
ready

Revisions

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