jQache

Benchmark created by danwit on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="https://jqache.com/js/jqache-0.1.1.min.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');
$('#target', '#container ul').css('border', '1px solid red');
$('#target', $('#target').parent()).css('border', '1px solid red');
$('.target', $(".target").parent()).css('border', '1px solid red');
ready
With jQache
$.q('#target').css('border', '1px solid red');
$.q('#container .target').css('border', '1px solid red');
$.q('li.target').css('border', '1px solid red');
$.q('.target').css('border', '1px solid red');
$.q('#container ul li.target').css('border', '1px solid red');
$.q('ul li.target').css('border', '1px solid red');
$.q('div#container ul li.target').css('border', '1px solid red');
$.q('li#target').css('border', '1px solid red');
$.q('#target', '#container ul').css('border', '1px solid red');
$.q('#target', $.q('#target').parent()).css('border', '1px solid red');
$.q('.target', $.q(".target").parent()).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.