jQuery 1.x vs 2.x

JavaScript performance comparison

Revision 8 of this test case created by

Preparation code

<script src="https://code.jquery.com/jquery-git1.js">
</script>
<script>
  jQ1 = jQuery.noConflict();
</script>
<script src="https://code.jquery.com/jquery-git2.js">
</script>
<script>
  jQ2 = jQuery.noConflict();
</script>
<div id="idSelector" style='display:none;'>
  <div class="classSelector">
    <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>
              </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>
      
<script>
Benchmark.prototype.setup = function() {
  function testcase(_$) {
    var ti = _$("#iteration").clone().html();
    _$("#iteration li").each(function(i, e) {
      _$("#idSelector").find("table").append('<tr></tr>')
    });
  };

};
</script>

Preparation code output

<script> jQ1 = jQuery.noConflict(); </script> <script src="https://code.jquery.com/jquery-git2.js"> </script> <script> jQ2 = jQuery.noConflict(); </script> <div id="idSelector" style='display:none;'> <div class="classSelector"> <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> </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>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
1.x
testcase(jQ1);
pending…
2.x
testcase(jQ2);
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.

0 Comments