jQuery vs JavaScript Performance Comparison

JavaScript performance comparison

Revision 44 of this test case created

Preparation code

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

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