jQuery vs JavaScript Performance Comparison

JavaScript performance comparison

Revision 46 of this test case created

Preparation code

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

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

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
01 jQ ID Selector
var $el = $('#hello');
pending…
01 JS ID Selector
var $el = document.getElementById('hello');
pending…
01 JS generic Selector
var $el = document.querySelector('#hello');
pending…
01 JS generic multiselect
var $el = document.querySelectorAll('#hello');
pending…
02 jQ Class Selector
var $el = $('.bye');
pending…
02 JS Class Selector
var $el = document.getElementsByClassName('bye');
pending…
02 JS generic SelectorAll
var $el = document.querySelectorAll('.bye');
pending…
03 jQ multiselect
var $el = $('#hello .bye');
pending…
03 JS 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. Here’s a list of current revisions for this page:

0 comments

Add a comment