HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 5 community runs

Desktop Results:
Chrome 5 runs
getting the html tag with querySelector
11.7M/s
getting the html tag with closest
5.2M/s

Fastest: getting the html tag with querySelector (2.3x faster)

View exact numbers
  • getting the html tag with querySelector: 11,706,380 ops/sec
  • getting the html tag with closest: 5,173,710 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    getting the html tag with querySelector
    getting the html tag with closest

    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; rv:139.0) Gecko/20100101 Firefox/139.0
Firefox 139 on Windows
View result in a separate tab
getting the html tag with closest
6.9M/s
getting the html tag with querySelector
4.6M/s
View exact numbers
Test name Executions per second
getting the html tag with closest 6,915,708 Ops/sec
getting the html tag with querySelector 4,564,749 Ops/sec