jquery 1.4.2 vs 1.9.1

JavaScript performance comparison

Revision 42 of this test case created by Paul Tregoing

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.4.2/jquery.min.js"></script>
<script> var $jq142 = jQuery.noConflict( true ); </script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script> var $jq191 = 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.4.2 by id
$jq142('#linkone');
pending…
1.9.1 by id
$jq191('#linkone')
pending…
1.4.2 by class
$jq142('.menuitem');
pending…
1.9.1 by class
$jq191('.menuitem');
pending…
1.4.2 descendent tag - class
$jq142('div.testmenu a');
pending…
1.9.1 descendent tag - class
$jq191('div.testmenu a');
pending…
1.4.2 by attr
$jq142('a[title="test"]');
pending…
1.9.1 by attr
$jq191('a[title="test"]');
pending…
1.4.2 with regex
$jq142('a[title*="item"]')
pending…
1.9.1 with regex
$jq191('a[title*="item"]');
pending…
1.4.2 nth-child(even)
$jq142('li:nth-child(even)');
pending…
1.9.1 nth-child(even)
$jq191('li:nth-child(even)');
pending…
1.4.2 input select
$jq142('input');
pending…
1.9.1 input select
$jq191('input');
pending…
1.4.2 unquoted attr with simpler regex
$jq142('div[class^=test]');
pending…
1.9.1 unquoted attr with simpler regex
$jq191('div[class^=test]');
pending…
1.4.2 unquoted attr check
$jq142('div[title=test]');
pending…
1.9.1 unquoted attr check
$jq191('div[title=test]');
pending…
1.4.2 tagged-Id
$jq142('div#test');
pending…
1.9.1 taggedId
$jq191('div#test');
pending…
1.4.2 generic descendant
$jq142('body div');
pending…
1.9.1 generic descendant
$jq191('body div');
pending…
1.4.2 multiple
$jq142('div, li, a');
pending…
1.9.1 multiple
$jq191('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