querySelectorAll(list of elements) vs getElementsByTagName(*) (v136)

Revision 136 of this benchmark created by Thomas Drach 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>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
querySelectorAll
var nodes = document.querySelectorAll('a, h1, h2, h3, h4, h5, h6, div, section, ul, li, ol, span, aside, img, figure, textarea, video, header, button, blockquote')
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.