jQuery.find vs jQuery('') (v3)

Revision 3 of this benchmark created by Denys Mishunov on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='body'>
<div id="map" class="map"></div>
</div>
<script>
  var $body = $('#body');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery.find
$body.find('.map');
ready
jQuery()
$('.map', $body);
ready
$body.find('#map');
ready
$('#map', $body);
ready
$('#map');
ready
document.getElementById('map');
ready
Simple selector by class
$('.map');
ready

Revisions

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