jquery 1.4.2 vs 1.9.1 (v43)

Revision 43 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.4.2/jquery.min.js"></script>
<script> var $jq142 = jQuery.noConflict( true ); </script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script> var $jq191 = jQuery.noConflict( true ); </script>

Test runner

Ready to run.

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

Revisions

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