jQuery 1.4.2 vs jQuery 1.8.2 vs jQuery 1.7.2 comparisons

JavaScript performance comparison

Revision 33 of this test case created by Erick chen

Preparation code

<script src="https://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
var $172 = jQuery.noConflict();
</script>

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

<script src="https://code.jquery.com/jquery-1.4.2.min.js"></script>
<script>
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>
 
</div>

<script>
  var context72 = $172("div.wrapper");
  var context82 = $182("div.wrapper");
  var context42 = $142("div.wrapper");
</script>
    

Preparation code output

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

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
$142(".class")
var item = $142(".buttonRef");
pending…
$182(".class")
var item = $182(".buttonRef");
pending…
$172(".class")
var item = $172(".buttonRef");
pending…
$142("#id")
var item = $142("#button");
pending…
$182("#id")
var item = $182("#button");
pending…
$172("#id")
var item = $172("#button");
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.7.2
var item = context72.find(".buttonRef")
pending…
width - Clas 1.4.2
width = $142(".content").width();
pending…
width - Clas 1.8.2
width = $182(".content").width();
pending…
width - Clas 1.7.2
width = $172(".content").width();
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.

0 Comments