HTML Preparation code:
x
 
1
<div id="testElement0"><div id="a2"></div></div>
2
<div id="testElement1"><div id="a3"></div></div>
3
<div id="testElement2"><div id="a4"></div></div>
4
<div id="testElement3"><div id="a5"></div></div>
5
<div id="testElement4"><div id="a7"></div></div>
6
<div id="testElement5"><div id="a9"></div></div>
7
<div id="testElement6"><div id="a8"></div></div>
8
<div id="testElement7"><div id="a6"></div></div>
9
<div id="testElement8"><div id="af"></div></div>
10
<div id="testElement9"><div id="as"></div></div>
11
<div id="testElement10"><div id="aa"><div id="b24242"></div></div></div>
12
<div id="testElement11"></div>
13
<div id="testElement12"></div>
14
<div id="testElement13"></div>
15
<div id="testElement14"></div>
16
<div id="testElement15"></div>
17
<div id="testElement16"></div>
18
<div id="testElement17"></div>
19
20
Tests:
  • getElementById

     
    var el = document.getElementById('b24242');
    var className = el.className;
  • querySelector

     
    var el = document.querySelector('#b24242');
    var className = el.className;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    getElementById
    querySelector

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 PaleMoon/29.0.1
Pale Moon (Firefox Variant) 29 on Windows
View result in a separate tab
Test name Executions per second
getElementById 4677179.0 Ops/sec
querySelector 1439244.5 Ops/sec