.find() Versus Selectors (v5)

Revision 5 of this benchmark created on


Description

Will the battle never end?

Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Selector
$('#a .b');
ready
Context
$('.b', $('#a'));
ready
.find()
$('#a').find('.b')
ready
Cached .find()
var $a = $('#a');
$a.find('.b')
ready
Cached Context
var $a = $('#a');
$('.b', $a)
ready
Speed .find()
$.find('.b');
ready
$('.b')
$('.b')
ready

Revisions

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