jQuery vs JavaScript Performance Comparison

JavaScript performance comparison

Revision 10 of this test case created

Preparation code

<div id="hello" data-id="hello">
</div>
<div class="bye" data-class="bye">
</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
JavaScript ID Selector
var $el = document.getElementById('hello');
pending…
JavaScript Class Selector
var $el = document.getElementsByClassName('bye');
pending…
JavaScript querySelectorAll Selector
var $el = document.querySelectorAll('[data-id="hello"]');
pending…
JavaScript Query Selector
var $el = document.querySelector('[data-id="hello"]');
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