jQuery vs JavaScript Performance Comparison (v44)

Revision 44 of this benchmark created on


Preparation HTML

<div id="hello"><div class="bye"></div></div>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js"></script>

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
02 jQ Class Selector
var $el = $('.bye');
ready
02 JS Class Selector
var $el = document.getElementsByClassName('bye');
ready
02 JS generic Selector
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.