jQache (v7)

Revision 7 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="https://rawgit.com/farzher/jQuery-Selector-Cache/master/src/jquery.sc.js">
</script>
<div id="container" style="display: none;">
  <ul>
    <li>
      1
    </li>
    <li class="target">
      2
    </li>
    <li id="target">
      3
    </li>
  </ul>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
Default jQuery
$('#target').css('border', '1px solid red');
$('#container .target').css('border', '1px solid red');
$('li.target').css('border', '1px solid red');
$('.target').css('border', '1px solid red');
$('#container ul li.target').css('border', '1px solid red');
$('ul li.target').css('border', '1px solid red');
$('div#container ul li.target').css('border', '1px solid red');
$('li#target').css('border', '1px solid red');
ready
With jQache
$$('#target').css('border', '1px solid red');
$$('#container .target').css('border', '1px solid red');
$$('li.target').css('border', '1px solid red');
$$('.target').css('border', '1px solid red');
$$('#container ul li.target').css('border', '1px solid red');
$$('ul li.target').css('border', '1px solid red');
$$('div#container ul li.target').css('border', '1px solid red');
$$('li#target').css('border', '1px solid red');
 
ready

Revisions

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