form.all vs. getElementById (v2)

Revision 2 of this benchmark created on


Preparation HTML

<html>
  
  <body>
    <form name="form1">
      <div id="div2">
        <div id="div1">
          <div id="div3">
          </div>
          <div id="div4">
          </div>
          <div id="div5">
          </div>
        </div>
      </div>
    </form>
  </body>

</html>

Test runner

Ready to run.

Testing in
TestOps/sec
getElementById
document.getElementById("div4");
ready
form1.all
form1.all.div4;
ready
document.getElementById("foo2")
document.getElementById("foo2");
ready
form2.all.foo2
form2.all.foo2;
ready

Revisions

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