jQuery vs JavaScript Performance Comparison (v59)

Revision 59 of this benchmark created by xaser on


Preparation HTML

<div id="hello"><div class="bye"></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

Revisions

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