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

Revision 97 of this benchmark created on


Preparation HTML

<div id="box">
  <div class="inner-box"> Hi </div>
</div>
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var box = $('#box');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Raw JS
document.getElementById("box").getElementsByTagName("div");
ready
"Right to Left"
$('#box').children('.inner-box');
$('#box').children('.inner-box');
ready
Alternate "Right to Left"
$('#box').find('.inner-box');
$('#box').find('.inner-box');
ready
jQuery Context
$('.inner-box', $('#box'));
$('.inner-box', $('#box'));
ready
Selector Context
$('.inner-box', '#box');
$('.inner-box', '#box');
ready
Predefined Context
$('.inner-box', box);
$('.inner-box', box);
ready
Predefined Find
box.find('.inner-box');
box.find('.inner-box');
ready
Child Selector
$('#box > .inner-box');
$('#box > .inner-box');
ready
Child
$('#box .inner-box');
$('#box .inner-box');
ready
Class direct
$('.inner-box');
$('.inner-box');
ready

Revisions

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