jQuery 1.9.1 vs. 2.0.0 (v29)

Revision 29 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

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