querySelectorAll vs getElementsByTagName (v39)

Revision 39 of this benchmark created on


Preparation HTML

<div>
  <ul>
    <li><a class="links" href="#">item 1</a></li>
    <li><a class="links" href="#">item 2</a></li>
    <li><a class="links" 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 = document.getElementsByTagName('a')
ready
getElementsByClassName
var nodes = document.getElementsByClassName('links')
ready

Revisions

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