jQuery 1.9.1 vs. 2.0.0

JavaScript performance comparison

Revision 39 of this test case created by David Laing

Info

Simple comparison of JQuery 1.9.1 and 2.0.0 "final" versions

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