jQuery vs JavaScript Performance Comparison (v46)

Revision 46 of this benchmark created on


Preparation HTML

<script src="//code.jquery.com/jquery-git2.min.js"></script>

<div id="hello"><div class="bye"><div class="bye"></div></div></div>

Test runner

Ready to run.

Testing in
TestOps/sec
01 jQ ID Selector
var $el = $('#hello');
ready
01 JS ID Selector
var $el = document.getElementById('hello');
ready
01 JS generic Selector
var $el = document.querySelector('#hello');
ready
01 JS generic multiselect
var $el = document.querySelectorAll('#hello');
ready
02 jQ Class Selector
var $el = $('.bye');
ready
02 JS Class Selector
var $el = document.getElementsByClassName('bye');
ready
02 JS generic SelectorAll
var $el = document.querySelectorAll('.bye');
ready
03 jQ multiselect
var $el = $('#hello .bye');
ready
03 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.