Query selector perf

JavaScript performance comparison

Revision 2 of this test case created

Info

Test a query selector with javascript, jquery, zepto, prototype, mootools, yui and dojo

Preparation code

<div class="find">
  <div class="find">
    <div class="find"></div>
    <div class="find"></div>
  </div>
  <div class="find"></div>
  <div class="find">
    <div class="find"></div>
    <div class="find">
      <div class="find"></div>
    </div>
  </div>
  <div class="find"></div>
</div>
<script src="http://code.jquery.com/jquery-2.0.0b2.js"></script>
<script>window.jQuery = $;$=null;</script>
<script src="http://zeptojs.com/zepto.min.js"></script>
<script>$=null;</script>
<script src="http://mootools.net/download/get/mootools-core-1.4.5-full-nocompat-yc.js"></script>
<script>window.MooTools = $$;$$=null;</script>
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js"></script>
<script>window.$prototype = $$;$$=null;</script>
<script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js"></script>
<script>YUI().use('node', function (Y) {
  window.Y = Y;
});</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js"></script>
<script>require(["dojo/query"], function(DojoQuery){
  window.DojoQuery = DojoQuery;
});</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
jQuery 2.0
jQuery(".find");
pending…
zepto
Zepto(".find");
pending…
mootools
MooTools(".find");
pending…
prototype
$prototype(".find");
pending…
javascript
document.querySelectorAll(".find");
pending…
yui
Y.all('.find');
pending…
dojo
DojoQuery(".find");
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