Speed comparison of jQuery versions (v33)

Revision 33 of this benchmark created on


Description

Fixed typo in benchmark code.

Preparation HTML

<div>
  <ul id="menu">
    <li class="menu-item">
    </li>
    <li class="menu-item">
    </li>
    <li class="menu-item">
    </li>
    <li class="menu-item">
    </li>
    <li class="menu-item">
    </li>
    <li class="menu-item">
    </li>
  </ul>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js">
</script>
<script>
  var $jq15 = $.noConflict(true);
</script>

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js">
</script>
<script>
  var $jq16 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
</script>
<script>
  var $jq17 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js">
</script>
<script>
  var $jq18 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
  var $jq19 = $.noConflict(true);
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.js">
</script>
<script>
  var $jq111 = $.noConflict(true);
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0b1.js">
</script>
<script>
  var $jq20 = $.noConflict(true);
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.js">
</script>
<script>
  var $jq21 = $.noConflict(true);
</script>

Setup

function tests($) {
      $('#menu').css({
        'background': 'red'
      });
      $('.menu-item').eq(2).hasClass('foo');
    }

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 2.1
tests($jq21);
ready
jQuery 1.11.0
tests($jq111);
ready
jQuery 1.5.2
tests($jq15);
ready

Revisions

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