querySelectorAll vs getElementsByTagName (v117)

Revision 117 of this benchmark created on


Preparation HTML

<div>
  <ul>
    <li class="test1"><a href="#">item 1</a></li>
    <li class="test2"><a href="#">item 2</a></li>
    <li class="test3"><a href="#">item 3</a></li>
  </ul>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
querySelectorAll
var node1 = document.querySelectorAll('a.test1');
var node2 = document.querySelectorAll('a.test2');
var node3 = document.querySelectorAll('a.test3');
ready
getElementsByTagName
var nodes = document.querySelectorAll('a.test1, a.test2, a.test3');
ready

Revisions

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