querySelector vs getElementByClassName (v88)

Revision 88 of this benchmark created by Andre JS on


Preparation HTML

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

Test runner

Ready to run.

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

Revisions

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