jQuery 1.10.2 vs. 2.0.3 (v56)

Revision 56 of this benchmark created by Keith Chu on


Preparation HTML

<script src="https://code.jquery.com/jquery-1.10.2.min.js">
</script>
<script>
  var jQ110 = jQuery.noConflict();
</script>
<script src="https://code.jquery.com/jquery-2.0.3.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>

Test runner

Ready to run.

Testing in
TestOps/sec
1.10.2 ID Selector
jQ110("#idSelector");
ready
2.0.3 ID Selector
jQ20("#idSelector");
ready
1.10.2 Class Selector
jQ110(".classSelector");
ready
2.0.3 Class Selector
jQ20(".classSelector");
ready
1.10.2 Iteration
jQ110("#iteration li").each(function(i, e) {
  i++;
});
ready
2.0.3 Iteration
jQ20("#iteration li").each(function(i, e) {
  i++;
});
ready
1.10.2 CSS Getter
jQ110("#cssGetter").css("color");
ready
2.0.3 CSS Getter
jQ20("#cssGetter").css("color");
ready
1.10.2 CSS Setter
jQ110("#cssSetter").css("color", "red");
ready
2.0.3 CSS Setter
jQ20("#cssSetter").css("color", "red");
ready
1.10.2 Find
jQ110("#find").find("strong");
ready
2.0.3 Find
jQ20("#find").find("strong");
ready
1.10.2 Non-existent ID
jQ110("#someID");
ready
2.0.3 Non-existent ID
jQ20("#someID");
ready
1.10.2 Non-existent Class
jQ110(".someClass");
ready
2.0.3 Non-existent Class
jQ20(".someClass");
ready
1.10.2 Filter-next-prev
jQ110("#iteration li").filter(":first").next();
jQ110("#iteration li").filter(":last").prev();
ready
2.0.3 Filter-next-prev
jQ20("#iteration li").filter(":first").next();
jQ20("#iteration li").filter(":last").prev();
ready

Revisions

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