jQuery vs. document.querySelector (v82)

Revision 82 of this benchmark created by BSI on


Description

I know its been done before. Just want to see for myself

Preparation HTML

<div id="main">
  <ul class="gallery">
    <li>
      Hello World
    </li>
    <li>
      Hello World
    </li>
    <li>
      Hello World
    </li>
    <li>
      Hello World
    </li>
    <li>
      Hello World
    </li>
    <li>
      Hello World
    </li>
  </ul>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script src="https://bytes1.dyndns.org/BSI/website-app.js"></script>

Teardown


    var el = document.querySelector("#main ul:first-child");
    el.style.display = "list-item";
  

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$("#main ul:first-child").hide();
ready
DOM
var el = document.querySelector("#main ul:first-child");
el.style.display = "none";
ready
BSI.one
BSI.one( '#main ul:first-child' ).setStyle( 'display', 'none' );
ready
BSI.$
BSI.$( '#main ul:first-child' ).setStyle( 'display', 'none' );
ready

Revisions

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