HTML Preparation code:
AخA
 
1
    <div>
2
        <p>12345</p>
3
        12345
4
    </div>
Script Preparation code:
 
var X = 0;
var A = document.body;
var B = document.body.querySelector("div>p");
var C = A.querySelector("div>p");
var D = A.querySelector("div");
var E = D.querySelector(":scope>p");
Tests:
  • 1

     
    document.body.querySelector("div>p").textContent = ++X;
  • 2

     
    B.textContent = ++X;
  • 3

     
    C.textContent = ++X;
  • 4

     
    E.textContent = ++X;
  • 5

     
    A.querySelector("div>p").textContent = ++X;
  • 6

     
    document.querySelector("div>p").textContent = ++X;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    1
    2
    3
    4
    5
    6

    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/123.0.0.0 Safari/537.36
Chrome 123 on Windows
View result in a separate tab
Test name Executions per second
1 336256.0 Ops/sec
2 516496.7 Ops/sec
3 525166.0 Ops/sec
4 527434.1 Ops/sec
5 399327.0 Ops/sec
6 312507.5 Ops/sec