Selectors perf 2 (v2)

Revision 2 of this benchmark created on


Preparation HTML

<div>
  <p class="child">
    Why Right to Left Thinking is Good
  </p>
  <p class="child">
    Blah Blah Blah
  </p>
  <p class="child">
    Why Right to Left Thinking is Good
  </p>
  <p class="child">
    <div id="parentDiv">
      <div id="childDiv1">
        <p class="child">
          Why Right to Left Thinking is Good
        </p>
        <p class="child">
          Blah Blah Blah
        </p>
      </div>
      <div id="childDiv2">
        <input type="text" id="txtID" class="txtClass">
          Why Right to Left Thinking is Good
        </p>
        <p class="child">
          Blah Blah Blah
        </p>
      </div>
      <div id="childDiv3">
        <p class="child">
          Why Right to Left Thinking is Good
        </p>
        <p class="child">
          Blah Blah Blah
        </p>
      </div>
      <div id="childDiv">
        <p class="child">
          Why Right to Left Thinking is Good
        </p>
        <p class="child">
          Blah Blah Blah
        </p>
      </div>
    </div>
  </p>
  <p class="child">
    Why Right to Left Thinking is Good
  </p>
  <p class="child">
    Blah Blah Blah
  </p>
  <p class="child">
    Why Right to Left Thinking is Good
  </p>
  <p class="child">
    Blah Blah Blah
  </p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
By Class
var xx = $('.txtClass');
ready
By ID
var xxx = $('#txtID')
ready
By Element
var yy = $('input');
ready
Psudo
var ccc = $(':text');
ready

Revisions

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