HTML Preparation code:
x
 
1
<html>
2
3
<body>
4
    <div>
5
        <div>
6
            <div>
7
                <div class="element">
8
                    <div class="test"></div>
9
                </div>
10
            </div>
11
        </div>
12
    </div>
13
</body>
14
15
</html>
Script Preparation code:
 
window.element = document.querySelector('.element');
Tests:
  • querySelector from document

     
    const theHtml = document.querySelector('.test');
  • querySelector from element

     
    const theHtml = element.querySelector('.test');
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    querySelector from document
    querySelector from element

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119 on Windows
View result in a separate tab
Test name Executions per second
querySelector from document 3871085.8 Ops/sec
querySelector from element 5430846.0 Ops/sec