jQuery 1.9.1 vs 2.0.0 release

JavaScript performance comparison

Revision 25 of this test case created

Preparation code

<script src="//code.jquery.com/jquery-1.9.1.min.js">
</script>
<script>
  jQ19 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-2.0.0.min.js">
</script>
<script>
  jQ20 = jQuery.noConflict();
</script>
<div id="domtestplase">
</div>
<script>
Benchmark.prototype.setup = function() {
    function testcase(_$) {
      _$("#domtestplase").html("<div id='idSelector'><div class='classSelector' data-ts='1'><div id='find'><div id='cssGetter' style='color: black;'><div id='cssSetter' style='color: black;'><ul id='iteration'><li><div id='editablearea'></div></li><li><p></li><li><input type='checkbox'></li><li><h>findme</h></li><li><table><thead></thead><tbody></tbody></table></li><li><textarea></textarea></li><li><span></span></li></ul></div></div><div></div></div></div></div>");
      _$("#idSelector").hide();
      var ti = _$("#iteration").clone().html();
      _$("#iteration li").each(function(i, e) {
        _$(this).click(function() {
          return this;
        });
        _$("#idSelector table tbody").append("<tr><td>start!</td></tr>");
        _$("#idSelector").find("table tbody tr:last td:last").before("<td>end!</td>");
        _$(this).off("click");
      });
      _$("#idSelector table").html("<thead></thead><tbody></tbody>");
      _$(".classSelector").toggleClass("test").data("ts", _$("#domtestplase").width()).attr('test', _$("#domtestplase").offset().top);
      _$('#idSelector input').is(':checked');
      _$('#idSelector :checkbox').is(':visible');
      _$('#idSelector [type="checkbox"]').change();
      _$("#editablearea").text(ti);
      _$("#cssGetter").css("color");
      _$("#cssSetter").css("color", "green").css({
        "opacity": "0.1",
        "float": "right"
      });
      var iil = _$("#idSelector #iteration li");
      iil.closest('ul');
      iil.filter(":first").next().end();
      iil.filter(":last").prev().parent();
      _$("div.classSelector").toggleClass("test").add(iil);
      _$("body #idSelector h:contains('findme')");
      _$("#idSelector").show();
      _$("#domtestplase").empty();
    };
};
</script>

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
testcase(jQ19);
pending…
2.0.0 release
testcase(jQ20);
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