jQuery.find vs jQuery('') (v4)

Revision 4 of this benchmark created on


Preparation HTML

<!-- script src="https://code.jquery.com/jquery-3.7.0.js"></script -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div id='parent'>
  <div class="child"></div>
</div>
<script>
  var $body = $('#parent');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.find()
$($body).find('.child').length;
ready
jQuery()
$('.child', $body).length;
ready
jQuery.has()
$($body).has('.child').length
ready
jQuery.children()
$($body).children('.child').length
ready

Revisions

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