jQache (v4)

Revision 4 of this benchmark created on


Description

A different performance test ( Changed iterations from 10'000 to 100)

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="//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>

Setup

var $$ = $.q;

Test runner

Ready to run.

Testing in
TestOps/sec
Default jQuery
var i, _i;

for (i = _i = 1; _i < 100; i = ++_i) {
  $("#target").text(i);
  $(".target").text(i);
}
 
ready
With jQuery manual cache
var i, _i, $target, $target_class;

$target = $("#target");
$target_class = $(".target");

for (i = _i = 1; _i < 100; i = ++_i) {
  $target.text(i);
  $target_class.text(i);
}
 
ready
With jQache
var i, _i;

for (i = _i = 1; _i < 100; i = ++_i) {
  $.q("#target").text(i);
  $.q(".target").text(i);
}
 
ready
With jQache ( but named as $$ )
var i, _i;

for (i = _i = 1; _i < 100; i = ++_i) {
  $$("#target").text(i);
  $$(".target").text(i);
}
 
ready

Revisions

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