jQuery .find() vs descendant selector (v52)

Revision 52 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<header>
  <nav>
    <form>
      <input>
    </form>
  </nav>
</header>
<article>
  <footer>
    <p id="parent">
      <input>
    </p>
  </footer>
</article>

Test runner

Ready to run.

Testing in
TestOps/sec
Descendant Selector
var search = $('#parent input');
ready
Child Selector
var search = $('#parent > input');
ready
Find
var search = $('#parent');
search = search.find('input')
ready

Revisions

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