getElementsByTagName vs getElementsByClassName (v9)

Revision 9 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
getElementsByTagName
for(i=0;i<100000;i++)document.getElementsByTagName("div");
ready
getElementsByClassName
for(i=0;i<100000;i++)document.getElementsByClassName("div");
ready

Revisions

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