jquery vs js 00112233

JavaScript performance comparison

Test case created by stefano solinas

Preparation code

<ul id="hello">
   <li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="a"></li><li class="b"></li>
</ul>
<div id="small">
<div class="a"></div>
<div class="b"></div>
</div>
<div class="zz">
<div id="inclass"></div>
</div>
<script src="//code.jquery.com/jquery-2.0.0.min.js"></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
$(".a");
$(".a");
pending…
$(".b");
$(".b");
pending…
document.querySelectorAll(".a");
 document.querySelectorAll(".a");
pending…
document.querySelectorAll(".b");
 document.querySelectorAll(".b");
pending…
$(".b","#small");
$(".b","#small");
pending…
$("#small .b");
$("#small .b");
pending…
document.querySelectorAll("#small .b");
 document.querySelectorAll("#small .b");
pending…
$(".zz #inclass");
$(".zz #inclass");
pending…
document.querySelectorAll(".zz #inclass");
 document.querySelectorAll(".zz #inclass");
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment