jQuery 1.11.1 vs 2.1.1

JavaScript performance comparison

Revision 74 of this test case created

Preparation code

<script src="//code.jquery.com/jquery-1.11.1.min.js">
</script>
<script>
  var jQ172 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-2.1.1.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.7.2 ID Selector
jQ172("#idSelector");
pending…
2.x ID Selector
jQ20("#idSelector");
pending…
1.7.2 Class Selector
jQ172(".classSelector");
pending…
2.x Class Selector
jQ20(".classSelector");
pending…
1.7.2 Iteration
jQ172("#iteration li").each(function(i, e) {
  i++;
});
pending…
2.x Iteration
jQ20("#iteration li").each(function(i, e) {
  i++;
});
pending…
1.7.2 CSS Getter
jQ172("#cssGetter").css("color");
pending…
2.x CSS Getter
jQ20("#cssGetter").css("color");
pending…
1.7.2 CSS Setter
jQ172("#cssSetter").css("color", "red");
pending…
2.x CSS Setter
jQ20("#cssSetter").css("color", "red");
pending…
1.7.2 Find
jQ172("#find").find("strong");
pending…
2.x Find
jQ20("#find").find("strong");
pending…
1.7.2 Non-existent ID
jQ172("#someID");
pending…
2.x Non-existent ID
jQ20("#someID");
pending…
1.7.2 Non-existent Class
jQ172(".someClass");
pending…
2.x Non-existent Class
jQ20(".someClass");
pending…
1.7.2 Filter-next-prev
jQ172("#iteration li").filter(":first").next();
jQ172("#iteration li").filter(":last").prev();
pending…
2.x Filter-next-prev
jQ20("#iteration li").filter(":first").next();
jQ20("#iteration li").filter(":last").prev();
pending…
1.7.2 .next-prev
jQ172("#iteration li").first().next();
jQ172("#iteration li").last().prev();
pending…
2.x .next-prev
jQ20("#iteration li").first().next();
jQ20("#iteration li").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