jQuery 1.4.2 vs jQuery 1.8.2 comparisons

JavaScript performance comparison

Revision 24 of this test case created

Info

Checking selector performance in different jQuery versions.

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/prototype/1/prototype.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></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.4.2.min.js"></script>
<script type="text/javascript">
var $142 = jQuery.noConflict();
</script>


<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 context82 = $182("div.wrapper");
  var context42 = $142("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.6.2
var item = $162(".buttonRef");
pending…
Get - Class 1.7.2
var item = $172(".buttonRef");
pending…
Get - Class 1.8.2
var item = $182(".buttonRef");
pending…
Context - Class 1.6.2
var item = $162(".buttonRef", context62);
pending…
Context - Class 1.7.2
var item = $172(".buttonRef", context72);
pending…
Context - Class 1.8.2
var item = $182(".buttonRef", context82);
pending…
Find - Class 1.6.2
var item = context62.find(".buttonRef")
pending…
Find - Class 1.7.2
var item = context72.find(".buttonRef")
pending…
Find - Class 1.8.2
var item = context82.find(".buttonRef")
pending…
Get - Class 1.4.2
var item = $142(".buttonRef");
pending…
Context - Class 1.4.2
var item = $142(".buttonRef", context42);
pending…
Find - Class 1.4.2
var item = context42.find(".buttonRef")
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