jquery vs querySelectorAll speedtest

Benchmark created by Tommy Hodgins on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementsByTagName
var tag = document.getElementsByTagName('div')
ready
querySelectorAll
var tag = document.querySelectorAll('div')
ready
jQuery
var tag = $('div')
ready

Revisions

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

  • Revision 1: published by Tommy Hodgins on