getElementById vs. querySelector (v115)

Revision 115 of this benchmark created on


Preparation HTML

<p class="foo">Foo</p>

Test runner

Ready to run.

Testing in
TestOps/sec
querySelector
var foo = document.querySelector("foo");
ready
getElementsByClassName
var foo = document.getElementsByClassName("foo")[0];
ready

Revisions

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