jQuery Selector Perf - Right-to-Left (v63)

Revision 63 of this benchmark created on


Preparation HTML

<div id="box">
  <div>
    <div>
      <div>
        <div>
          <p>Hello</p>
          <p>World!</p>
        </div>
      </div>
    </div>
  </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
  var $box = $('#box');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
single selector
$('#box p');
ready
ID then children
$('#box').children('p');
ready
ID then find
$('#box').find('p');
ready
cached context
var i = $('p', $box);
alert(i);
 
ready
cached find
$box.find('p');
ready

Revisions

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