querySelectorAll vs getElementsByTagName (v130)

Revision 130 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div>
  <ul>
    <li><a href="#">item 1</a></li>
    <li><a href="#">item 2</a></li>
    <li><a href="#">item 3</a></li>
  </ul>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
querySelectorAll
var nodes = document.querySelectorAll('a')
ready
getElementsByTagName
var nodes = $('a').first()
ready

Revisions

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