jQuery vs JavaScript Performance Comparison (v35)

Revision 35 of this benchmark created on


Preparation HTML

<div id="hello"></div>
<div class="bye"></div>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="//cdn.sencha.io/ext-4.2.0-gpl/ext-all.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery ID Selector
var $el = $('#hello');
ready
JavaScript ID Selector
var $el = document.querySelector('#hello');
ready
jQuery Class Selector
var $el = $('.bye');
ready
JavaScript Class Selector
var $el = document.querySelector('.bye');
ready
GetElementById
var $el = document.getElementById('hello')
ready
jGetElementById
var el = document.getElementById('hello');
var $el = $(el)
ready
ExtJS id
var $el = Ext.query('#Hello');
ready
ExtJS class
var $el = Ext.query('.bye');
ready
getElementByClassName
var $el = document.getElementsByClassName('bye');
ready

Revisions

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