jQuery vs JavaScript Performance Comparison (v30)

Revision 30 of this benchmark created on


Preparation HTML

<div id="hello"><div class="bye"></div></div>
<script src="https://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
JS ID Selector
var $el = document.getElementById('hello');
ready
JS generic Selector
var $el = document.querySelector('#hello');
ready
jQ Class Selector
var $el = $('.bye');
ready
JS Class Selector
var $el = document.getElementsByClassName('bye');
ready
JS generic Selector
var $el = document.querySelectorAll('.bye');
ready
jQ multiselect
var $el = $('#hello .bye');
ready
JS multiselect
var $el = document.querySelectorAll('#hello .bye');
ready

Revisions

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