the fastest dom thing

Benchmark created on


Preparation HTML

<div id="myid1" class="c1"></div>
<div id="myid2" class="c2"></div>
<div id="myid3" class="c3"></div>
<div id="myid4" class="c4"></div>
<div id="myid5" class="c5"></div>
<div id="myid6" class="c6"></div>
<div id="myid7" class="c7"></div>
<div id="myid8" class="c8"></div>
<div id="myid9" class="c9"></div>
<div id="myid10" class="c10"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
id
document.getElementById('myid4');
ready
class
document.getElementsByClassName('c4')[0];
ready

Revisions

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