jQuery vs native selector (v12)

Revision 12 of this benchmark created on


Description

Select elements by class.

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="food"><div class="food"></div><div class="nonfood"></div><div class="foo"></div></div><div class="nonfood"><div class="food"></div><div class="nonfood"></div><div class="foo"></div></div><div class="foo"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
var f = $(".foo");
ready
querySelectorAll
var f = document.querySelectorAll(".foo");
ready
getElementsByClassName
var f = document.getElementsByClassName("foo");
ready

Revisions

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