jquery 1.4 vs 1.5

JavaScript performance comparison

Revision 3 of this test case created by Dan Heberden

Info

More direct testing - now with 1.5.2

Preparation code

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