jQuery vs JavaScript Performance Comparison (v41)

Revision 41 of this benchmark created on


Description

jquery 1.7.1

Preparation HTML

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

<script src = "http://code.jquery.com/jquery-1.7.1.min.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

Revisions

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