Speed comparison of jQuery versions (v14)

Revision 14 of this benchmark created on


Description

Testing the class selector and DOM manipulation spped

Preparation HTML

<div>
  <ul id="menu">
    <li class="menu-item">
<div id="test1" class="tfc-fitrec-product"></div>
    </li>
    <li class="menu-item">
<div id="test2" class="tfc-fitrec-product"></div>
    </li>
    <li class="menu-item">
<div id="test3" class="tfc-fitrec-product"></div>
    </li>
    <li class="menu-item">
<div id="test4" class="tfc-fitrec-product"></div>
    </li>
    <li class="menu-item">
<div id="test5" class="tfc-fitrec-product"></div>
    </li>
    <li class="menu-item">
<div id="test6" class="tfc-fitrec-product"></div>
    </li>
  </ul>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js">
</script>
<script type="text/javascript">
  var $jq16 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
</script>
<script type="text/javascript">
  var $jq17 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js">
</script>
<script type="text/javascript">
  var $jq18 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script type="text/javascript">
  var $jq19 = $.noConflict(true);
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0b1.js">
</script>
<script type="text/javascript">
  var $jq20 = $.noConflict(true);
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js">
</script>
<script type="text/javascript">
  var $jq12 = $.noConflict(true);
</script>

Setup

function tests($) {
      $('.tfc-fitrec-product').each(function(i, e){
        var $this = $(e);
        $this.html('').html("\u000a<div class=\"tfc-fitrec-result success\">\u000a<div class=\"badge\"></div>\u000a<div class=\"instruction-wrapper\"><table cellspacing=\"0\" cellpadding=\"0\"><tr><td class=\"bottom\">\u000a<div>True Fit<span class=\"tfc-regtm\">\u00ae</span><span class=\"tfc-regtm-transparent\">\u00a0\u00a0\u00a0</span> Size for <span class=\"tfc-first-name\">You</span>: <span class=\"tfc-size\">L</span></div>\u000a</td></tr><tr><td class=\"top\">\u000a<div class=\"prompt dialog-trigger\">How will this fit me?</div>\u000a</td></tr></table></div>\u000a</div>\u000a");
    
      $('.tfc-first-name', $this).text('John');
      $('.tfc-size', $this).text('S');
      });
    }

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery 1.6.x
tests($jq16);
ready
jQuery 1.7.x
tests($jq17);
ready
jQuery 1.8.x
tests($jq18);
ready
jQuery 1.9.1
tests($jq19);
ready
jQuery 2.0 beta 1
tests($jq20);
ready
jQuery 1.2.3
tests($jq12);
ready

Revisions

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