querySelector vs getElementsByTagName[0] (v67)

Revision 67 of this benchmark created by niklas 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 node = document.querySelector('a')
ready
getElementsByTagName
var node = document.getElementsByTagName('a')[0]
ready

Revisions

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