jQuery vs JavaScript Performance Comparison (v5)

Revision 5 of this benchmark created on


Preparation HTML

<div id="hello">
</div>
<div class="bye">
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery ID Selector Append
var $el = $('#hello');
 
ready
JavaScript ID Append
var $el = document.getElementById('#hello');

 
ready
jQuery Class Selector
var $el = $('.bye');
 
ready
JavaScript Class Selector
var $el = document.getElementsByClassName('.bye');
 
ready

Revisions

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