jQuery 1.5 Unique Traversal (v15)

Revision 15 of this benchmark created on


Description

See: http://bugs.jquery.com/ticket/7964

Preparation HTML

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script>var a = jQuery.noConflict(), aa;</script>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
<script>var b = jQuery.noConflict(), bb;</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>var c = jQuery.noConflict(), cc;</script>
<div id="tests" style="display:none;"></div>

Setup

var i, j, ac = 0,
      bc = 0,
      html = "";
 
  for (j = 0; j < 20; j++) {
   html += "<div class='jq144'>";
   for (i = 0; i < 5; i++) {
    html += "<div>abcdefghijklmnopqrstuvwxyz</div><div>0123456789</div>";
   }
   html += "</div>";
  }
 
  for (j = 0; j < 20; j++) {
   html += "<div class='jq150'>";
   for (i = 0; i < 5; i++) {
    html += "<div>abcdefghijklmnopqrstuvwxyz</div><div>0123456789</div>";
   }
   html += "</div>";
  }

  for (j = 0; j < 20; j++) {
   html += "<div class='jq164'>";
   for (i = 0; i < 5; i++) {
    html += "<div>abcdefghijklmnopqrstuvwxyz</div><div>0123456789</div>";
   }
   html += "</div>";
  }
  document.getElementById("tests").innerHTML = html;

  aa = a(".jq144");
  bb = b(".jq150");
  cc = c(".jq164");

Test runner

Ready to run.

Testing in
TestOps/sec
.parent() - jQuery 1.4.4
aa.parent();
ready
.parent() - jQuery 1.5
bb.parent();
ready
.parent() - jQuery 1.6.4
cc.parent();
ready
.next() - jQuery 1.4.4
aa.next();
ready
.next() - jQuery 1.5
bb.next();
ready
.next() - jQuery 1.6.4
cc.next();
ready
.prev() - jQuery 1.4.4
aa.prev();
ready
.prev() - jQuery 1.5
bb.prev();
ready
.prev() - jQuery 1.6.4
cc.prev();
ready

Revisions

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