querySelectorAll vs. getElementsByTagName (v156)

Revision 156 of this benchmark created on


Preparation HTML

<p class="derp" id="foo">Foo</p>
<p class="derp" id="bar">Bar</p>
<p class="herp" id="baz">Baz</p>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementsByTagName
var bar = document.getElementsByTagName("p")[0];
ready
querySelectorAll
var bar = document.querySelectorAll("p")[0];
ready

Revisions

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