zepto vs jquery - selectors

JavaScript performance comparison

Revision 27 of this test case created

Preparation code

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.1/zepto.min.js"></script>

<div id="rsvp" class="view" data-view-title="RSVPs">
    <div class="content"></div>
</div>
<div id="chapter_004" class="view" data-view-title="Splendid Corgi Consortium">
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
    <div class="content"></div>
</div>
<script>
Benchmark.prototype.setup = function() {
    function id(id) {
      return document.getElementById(id);
    }
};
</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
Zepto ID
Zepto('#chapter_004 div')
pending…
jQuery ID
jQuery('#chapter_004 div')
pending…
querySelector
document.querySelector('#chapter_004 div')
pending…
querySelectorAll
document.querySelectorAll('#chapter_004 div')
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