jQuery vs JavaScript Performance Comparison (v60)

Revision 60 of this benchmark created on


Preparation HTML

<div class="tmp"><div id="hello"><span class="bye">hello</span></div></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQ ID Selector
var $el = $('#hello');
ready
getElementById
var $el = document.getElementById('hello');
ready
querySelector
var $el = document.querySelector('#hello');
ready
jQ Class Selector
var $el = $('.bye');
ready
getElementsByClassName
var $el = document.getElementsByClassName('bye');
ready
querySelectorAll
var $el = document.querySelectorAll('.bye');
ready
jQ multiselect
var $el = $('#hello .bye');
ready
querySelectorAll multiselect
var $el = document.querySelectorAll('#hello .bye');
ready
getElementsByTagName
var $el = document.getElementsByTagName('span');
ready
jQ Tag Selector
var $el = $('span');
ready

Revisions

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