jQuery 1.5.1 Unique Traversal

JavaScript performance comparison

Revision 9 of this test case created

Info

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

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>var a = jQuery.noConflict(), aa;</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>var b = jQuery.noConflict(), bb;</script>
<div id="tests" style="display:none;"></div>
<script>
  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>";
  }
  document.getElementById("tests").innerHTML = html;
 
  aa = a(".jq144");
  bb = b(".jq150");
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
.children() - jQuery 1.4.4
aa.children();
pending…
.children() - jQuery 1.5.1
bb.children();
pending…
.next() - jQuery 1.4.4
aa.next();
pending…
.next() - jQuery 1.5.1
bb.next();
pending…
.prev() - jQuery 1.4.4
aa.prev();
pending…
.prev() - jQuery 1.5.1
bb.prev();
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment