getElementById vs getElementsByClassName (v2)

Revision 2 of this benchmark created on


Preparation HTML

<div class="div" id="div"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
document.getElementById("div");
ready
getElementsByClassName
document.getElementsByClassName("div");
ready

Revisions

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