zepto vs jquery - selectors

JavaScript performance comparison

Revision 80 of this test case created by Frederik Krautwald

Preparation code

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script>
<script src="https://larukedi.github.io/laroux.js/assets/js/laroux.base.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>

      
<script>
Benchmark.prototype.setup = function() {
  function id(id) {
    return document.getElementById(id);
  }

};
</script>

Preparation code output

<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script> <script src="https://larukedi.github.io/laroux.js/assets/js/laroux.base.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>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Zepto ID
Zepto('[data-view-title]')
pending…
jQuery ID
jQuery('[data-view-title]')
pending…
querySelector
document.querySelector('[data-view-title]')
pending…
querySelectorAll
document.querySelectorAll('[data-view-title]')
pending…
laroux.js
$l('[data-view-title]')
pending…
laroux.js array
$l(['[data-view-title]'])
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.

0 Comments