jquery 1.4.2 vs 1.6.2 (v40)

Revision 40 of this benchmark created on


Description

Comparison of performance between jQuery versions

Preparation HTML

<div id="test"> 
        <div class="testlink">
                <a href="#" id="linkone" title="test">test link</a>
        </div> 
        <input type="text" val="test"/>
        <div class="testmenu">
                <ul>
                        <li class="menuitem itemone">
                                <a href="#" title="item 1">menu item 1</a>
                        </li>
                        <li class="menuitem itemtwo">
                                <a href="#" title="item 2">menu item 2</a>
                        </li>
                        <li class="menuitem itemthree">
                                not clickable item 3
                        </li>
                </ul>
        </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script> var $jq17 = jQuery.noConflict( true ); </script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script> var $jq18 = jQuery.noConflict( true ); </script>

Test runner

Ready to run.

Testing in
TestOps/sec
1.7 by id
$jq17('#linkone');
ready
1.8 by id
$jq18('#linkone')
ready
1.7 by class
$jq17('.menuitem');
ready
1.8 by class
$jq18('.menuitem');
ready
1.7 descendent tag - class
$jq17('div.testmenu a');
ready
1.8 descendent tag - class
$jq18('div.testmenu a');
ready
1.7 by attr
$jq17('a[title="test"]');
ready
1.8 by attr
$jq18('a[title="test"]');
ready
1.7 with regex
$jq17('a[title*="item"]')
ready
1.8 with regex
$jq18('a[title*="item"]');
ready
1.7 nth-child(even)
$jq17('li:nth-child(even)');
ready
1.8 nth-child(even)
$jq18('li:nth-child(even)');
ready
1.7 input select
$jq17('input');
ready
1.8 input select
$jq18('input');
ready
1.7 unquoted attr with simpler regex
$jq17('div[class^=test]');
ready
1.8 unquoted attr with simpler regex
$jq18('div[class^=test]');
ready
1.7 unquoted attr check
$jq17('div[title=test]');
ready
1.8 unquoted attr check
$jq18('div[title=test]');
ready
1.7 tagged-Id
$jq17('div#test');
ready
1.8 taggedId
$jq18('div#test');
ready
1.7 generic descendant
$jq17('body div');
ready
1.8 generic descendant
$jq18('body div');
ready
1.7 multiple
$jq17('div, li, a');
ready
1.8 multiple
$jq18('div, li, a');
ready

Revisions

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