test document queryselector and jquery

Benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div>
  <section>
    <div class="foo">
      <div class="bar" id="foobar">
        <ul>
          <li>
            test1
          </li>
          <li>
            test2
          </li>
        </ul>
      </div>
    </div>
  </section>
</div>

Setup

window.$$ = function() {
      return document.querySelectorAll.apply(document, arguments)
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Native - without ID
$$("section .foo .bar ul")
ready
Native - with ID
$$("#foobar ul")
ready
jquery - without id
$("section .foo .bar ul")
ready
jquery - with id
$("#foobar ul")
ready

Revisions

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