jQuery 1.9.1 vs. 2.0.0

JavaScript performance comparison

Revision 29 of this test case created

Preparation code

<script src="//code.jquery.com/jquery-1.9.1.min.js">
</script>
<script>
  var jQ19 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-2.0.0.min.js">
</script>
<script>
  var jQ20b = jQuery.noConflict();
</script>
<div id="idSelector">
</div>
<div class="classSelector">
</div>
<ul id="iteration">
  <li>
  </li>
  <li>
  </li>
  <li>
  </li>
  <li>
  </li>
  <li>
  </li>
  <li>
  </li>
  <li>
  </li>
</ul>
<div id="cssGetter" style="color: black;">
</div>
<div id="cssSetter" style="color: black;">
</div>
<div id="find">
  <span>
  </span>
  <div>
    <strong>
    </strong>
  </div>
</div>

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
ID Selector (1.9)
jQ19("#idSelector");
pending…
ID Selector (2.0)
jQ20b("#idSelector");
pending…
Class Selector (1.9)
jQ19(".classSelector");
pending…
Class Selector (2.0)
jQ20b(".classSelector");
pending…
Iteration (1.9)
jQ19("#iteration li").each(function(i, e) {
  i++;
});
pending…
Iteration (2.0)
jQ20b("#iteration li").each(function(i, e) {
  i++;
});
pending…
CSS Getter (1.9)
jQ19("#cssGetter").css("color");
pending…
CSS Getter (2.0)
jQ20b("#cssGetter").css("color");
pending…
CSS Setter (1.9)
jQ19("#cssSetter").css("color", "red");
pending…
CSS Setter (2.0)
jQ20b("#cssSetter").css("color", "red");
pending…
Find (1.9)
jQ19("#find").find("strong");
pending…
Find (2.0)
jQ20b("#find").find("strong");
pending…
Non-existent ID (1.9)
jQ19("#someID");
pending…
Non-existent ID (2.0)
jQ20b("#someID");
pending…
Non-existent Class (1.9)
jQ19(".someClass");
pending…
Non-existent Class (2.0)
jQ20b(".someClass");
pending…
Filter-next-prev (1.9)
jQ19("#iteration li").filter(":first").next();
jQ19("#iteration li").filter(":last").prev();
pending…
Filter-next-prev (2.0)
jQ20b("#iteration li").filter(":first").next();
jQ20b("#iteration li").filter(":last").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