querySelectorAll vs getElementsByTagName (v92)

Revision 92 of this benchmark created by Yaroslaff Fedin on


Preparation HTML

<div id="id">
  <ul>
    <li><a href="#">item 1</a></li>
    <li><a href="#">item 2</a></li>
    <li><a href="#">item 3</a></li>
  </ul>
</div>

Setup

d = document.getElementById('id')

Test runner

Ready to run.

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

Revisions

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