jQuery vs. document.querySelector (v89)

Revision 89 of this benchmark created on


Description

I know its been done before. Just want to see for myself

Preparation HTML

<div id="div">
<div>
<div>
<div>
<div>
<div>
<div>
<ul>
<li></li><li></li><li></li></ul>
</div></div></div></div></div></div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
jQuery
$('#div li:first-child')
ready
DOM
$(document.querySelectorAll('#div li:first-child'))
ready

Revisions

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