jQuery 1.x vs 2.x (v9)

Revision 9 of this benchmark created on


Description

Performance regressions in jQuery 2.x

Preparation HTML

<script src="//code.jquery.com/jquery-git1.js">
</script>
<script>
  jQ1 = jQuery.noConflict();
</script>
<script src="//code.jquery.com/jquery-git2.js">
</script>
<script>
  jQ2 = jQuery.noConflict();
</script>
<div id="wrapper">
</div>

Setup

document.querySelector("#wrapper").innerHTML = '\n\
    <div id="idSelector" style="display: none;">\n\
      <div class="classSelector">\n\
        <div id="find">\n\
          <div id="cssGetter" style="color: black;">\n\
            <div id="cssSetter" style="color: black;">\n\
              <div id="editablearea"></div>\n\
              <ul id="iteration">\n\
                <li>\n\
                  <div></div>\n\
                </li>\n\
                <li>\n\
                  <p>\n\
                </li>\n\
                <li>\n\
                  <input type="checkbox">\n\
                </li>\n\
                <li>\n\
                  <h>\n\
                  </h>\n\
                </li>\n\
                <li>\n\
                  <table>\n\
                    <thead>\n\
                    </thead>\n\
                    <tbody>\n\
                    </tbody>\n\
                  </table>\n\
                </li>\n\
                <li>\n\
                  <textarea>\n\
                  </textarea>\n\
                </li>\n\
                <li>\n\
                  <span>\n\
                  </span>\n\
                </li>\n\
              </ul>\n\
            </div>\n\
          </div>\n\
          <div>\n\
          </div>\n\
        </div>\n\
      </div>\n\
    </div>\n\
    ';
    
    function testcase($) {
      $(".classSelector input").css("border", "5px solid #00f");
      $("#find textarea").hide();
    }

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery 1.x
testcase(jQ1);
ready
jQuery 2.x
testcase(jQ2);
ready

Revisions

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