zepto vs jquery - selectors (v18)

Revision 18 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/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>

Setup

var Zdocument = Zepto(document);
    var $document = jQuery(document);

Test runner

Ready to run.

Testing in
TestOps/sec
Zepto ID
Zdocument.find('#chapter_004');
ready
jQuery ID
$document.find('#chapter_004')
ready
getElementById
document.getElementById('chapter_004')
ready
querySelector
document.querySelector('#chapter_004')
ready
Zepto ClassName
Zdocument.find('.view')
ready
jQuery ClassName
$document.find('.view')
ready
getElementsByClassName
document.getElementsByClassName('view')
ready
querySelectorAll
document.querySelectorAll('.view')
ready

Revisions

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