jQUery Selectors vs Native API (v19)

Revision 19 of this benchmark created on


Preparation HTML

<div id="testid"></div>
<div class="testclass"></div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery ID Selector
$("#testid");
ready
getElementById
document.getElementById("testid");
ready
Native ECMA5
document.querySelector("#testid");
ready
Jquery By class
$(".testclass");
 
ready
Native ECMA5
document.querySelector(".testclass");
ready
Native
document.getElementsByClassName("testClass");
ready

Revisions

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