jquery 1.4.2 vs 1.6.2

JavaScript performance comparison

Revision 40 of this test case created

Info

Comparison of performance between jQuery versions

Preparation code

<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>
 

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

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

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment