jQuery() vs. querySelectorAll() (v8)

Revision 8 of this benchmark created by Jonathan Cousins on


Preparation HTML

<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>
<section>
<div>
<ul>
    <li class="test">One</li>
    <li>Two</li>
    <li class="test">Three</li>
</ul>
<ul>
    <li class="test">One</li>
    <li>Two</li>
    <li class="test">Three</li>
</ul>
<div>
<ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>
<ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>
</div>
<div>
<ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>
<ul>
    <li>One</li>
    <li>Two</li>
    <li>Three</li>
</ul>
</div>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery()
$( "div ul li:nth-child(2n)" );
ready
querySelectorAll()
$(document.querySelectorAll( "div ul li:nth-child(2n)" ));
ready

Revisions

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

  • Revision 1: published by TJ VanToll on
  • Revision 2: published by Fabio77 on
  • Revision 3: published by Fabio on
  • Revision 4: published by Fabio77 on
  • Revision 5: published by Hemn Chawroka on
  • Revision 6: published on
  • Revision 7: published on
  • Revision 8: published by Jonathan Cousins on