HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 9 community runs

Desktop Results:
Chrome 9 runs
getElementById
19.5M/s
getElementsByName
10.7M/s

Fastest: getElementById (1.8x faster)

View exact numbers
  • getElementById: 19,480,082 ops/sec
  • getElementsByName: 10,658,136 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
    getElementById
    getElementsByName

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 10 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Chrome 140 on Mac OS X 10.15.7
View result in a separate tab
getElementById
47.4M/s
getElementsByName
21.6M/s
View exact numbers
Test name Executions per second
getElementById 47,367,068 Ops/sec
getElementsByName 21,625,008 Ops/sec