jQuery 1.4.4 vs 1.8.3 vs 1.11.1 vs 1.6.4 vs 2.1.1 comparisons

JavaScript performance comparison

Revision 50 of this test case created

Info

Checking selector performance in different jQuery versions.

Preparation code

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

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

<script src="//code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
var $183 = 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.4.min.js"></script>
<script type="text/javascript">
var $144 = 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 context44 = $144("div.wrapper");
  var context64 = $164("div.wrapper");
  var context83 = $183("div.wrapper");
  var context111 = $1111("div.wrapper");
  var context211 = $211("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.4
var item = $144(".buttonRef");
pending…
Get - Class 1.8.3
var item = $183(".buttonRef");
pending…
Get - Class 1.11.1
var item = $1111(".buttonRef");
pending…
Context - Class 1.4.4
var item = $144(".buttonRef", context44);
pending…
Context - Class 1.8.3
var item = $183(".buttonRef", context83);
pending…
Context - Class 1.11.1
var item = $1111(".buttonRef", context111);
pending…
Find - Class 1.4.4
var item = context44.find(".buttonRef")
pending…
Find - Class 1.8.3
var item = context83.find(".buttonRef")
pending…
Find - Class 1.11.1
var item = context111.find(".buttonRef")
pending…
outerWidth - Clas 1.4.4
outerWidth = $144(".content").outerWidth(true);
pending…
outerWidth - Class 1.8.3
outerWidth = $183(".content").outerWidth(true);
pending…
outerWidth - Class 1.11.1
outerWidth = $1111(".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…
Get - Class 2.1.1
var item = $211(".buttonRef");
pending…
Context - Class 2.1.1
var item = $211(".buttonRef", context211);
pending…
Find - Class 2.1.1
var item = context211.find(".buttonRef")
pending…
outerWidth - Class 2.1.1
outerWidth = $211(".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