querySelectorAll vs getElementsByTagName (v25)

Revision 25 of this benchmark created on


Preparation HTML

<div>
  <ul>
    <li><a href="#">item 1</a></li>
    <li><a href="#">item 2</a></li>
    <li><a href="#">item 3</a></li>
  </ul>
<a href="#"><span>Hello</span></a>
<strong>Bold!</strong>
</div>

Test runner

Ready to run.

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

Revisions

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