Speed comparison of jQuery versions (v11)

Revision 11 of this benchmark created on


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>
    
  </ul>
</div>


<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<script>
  var $jq171 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">
</script>
<script>
  var $jq1101 = $.noConflict(true);
</script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js">
</script>
<script>
  var $jq202 = $.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.7.1
tests($jq171);
ready
jQuery 1.10.1
tests($jq1101);
ready
jQuery 2.0.2
tests($jq202);
ready

Revisions

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