jQuery vs JavaScript Performance Comparison

JavaScript performance comparison

Revision 60 of this test case created by

Preparation code

<div class="tmp"><div id="hello"><span class="bye">hello</span></div></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    

Preparation code output

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

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
getElementsByTagName
var $el = document.getElementsByTagName('span');
pending…
jQ Tag Selector
var $el = $('span');
pending…
jQ ID Selector
var $el = $('#hello');
pending…
getElementById
var $el = document.getElementById('hello');
pending…
querySelector
var $el = document.querySelector('#hello');
pending…
jQ Class Selector
var $el = $('.bye');
pending…
getElementsByClassName
var $el = document.getElementsByClassName('bye');
pending…
querySelectorAll
var $el = document.querySelectorAll('.bye');
pending…
jQ multiselect
var $el = $('#hello .bye');
pending…
querySelectorAll multiselect
var $el = document.querySelectorAll('#hello .bye');
pending…

Compare results of other browsers

Revisions

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

1 Comment

Mike commented :

I think it might help to make the results clearer. When you say for instance "1,197,313 ±3.17%100% slower", what do you mean? Which is slower than which? In other words state whether you mean "jquery is 1,197,313 ±3.17%100% slower than javascript". Otherwise you just show a test with results but not clear which way the test is pointing to. I can see where someone might assume it could be the other way around.

hello