jQuery 1.4.2 vs jQuery 1.8.2 vs jQuery 1.9.0 comparisons

JavaScript performance comparison

Revision 34 of this test case created

Info

Checking selector performance in different jQuery versions.

Preparation code

<script src="//code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
var $190 = jQuery.noConflict();
</script>

<script src="//code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
var $182 = jQuery.noConflict();
</script>

<script src="//code.jquery.com/jquery-1.6.4.min.js">
</script>
<script>
  var $164 = jQuery.noConflict();
</script>

<script src="//code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
var $142 = jQuery.noConflict();
</script>

<style type="text/css">
    .content {
        padding: 0px 10px;
        margin: 0px 5px;
        border: 1px solid orange;
    }
</style>

<div class="wrapper">
     <div class="innerWrapper">
          <div class="button">
               <a href="" id="button" class="buttonRef">
                    <span class="buttonText">Text</span>
               </a>
          </div>
     </div>

    <img class="content" src="http://petskink.net/images/orangegirl.jpg" alt="sample image"/>
</div>

<script>
  var context90 = $190("div.wrapper");
  var context82 = $182("div.wrapper");
  var context42 = $142("div.wrapper");
  var context64 = $164("div.wrapper");
</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
Get - Class 1.4.2
var item = $142(".buttonRef");
pending…
Get - Class 1.8.2
var item = $182(".buttonRef");
pending…
Get - Class 1.9.0
var item = $190(".buttonRef");
pending…
Context - Class 1.4.2
var item = $142(".buttonRef", context42);
pending…
Context - Class 1.8.2
var item = $182(".buttonRef", context82);
pending…
Context - Class 1.9.0
var item = $190(".buttonRef", context90);
pending…
Find - Class 1.4.2
var item = context42.find(".buttonRef")
pending…
Find - Class 1.8.2
var item = context82.find(".buttonRef")
pending…
Find - Class 1.9.0
var item = context90.find(".buttonRef")
pending…
outerWidth - Clas 1.4.2
outerWidth = $142(".content").outerWidth(true);
pending…
outerWidth - Clas 1.8.2
outerWidth = $182(".content").outerWidth(true);
pending…
outerWidth - Clas 1.9.0
outerWidth = $190(".content").outerWidth(true);
pending…
Get - Class 1.6.4
var item = $164(".buttonRef");
pending…
Context - Class 1.6.4
var item = $164(".buttonRef", context64);
pending…
Find - Class 1.6.4
var item = context64.find(".buttonRef")
pending…
outerWidth - Class 1.6.4
outerWidth = $164(".content").outerWidth(true);
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