jQuery 1.9.1 vs. 2.0.3 beta

JavaScript performance comparison

Revision 47 of this test case created

Preparation code

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