jQuery .find() vs CSS selector, w/o special case (v29)

Revision 29 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id='myDiv'>
  <div class="childDiv">
               <p>hello <a href="http://www.example.com/">link</a></p>
  </div> 
</div>
<script>
  if (!window.console || !window.console.log) {
   throw 'console.log() is not supported. Please install Firebug. http://getfirebug.com'
  }
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.find()
$('#myDiv').find('aa');
ready
css selector
$('#myDiv a');
ready
Parent > child
$('#myDiv > .childDiv:first-of-type > a');
ready

Revisions

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