HTML Preparation code:
Tests:

Historical Performance Data aggregated from 83 community runs

Desktop Results:
Chrome 72 runs
className
4K/s
getComputedStyle
677/s

Fastest: className (5.3x faster)

View exact numbers
  • className: 3,586 ops/sec
  • getComputedStyle: 677 ops/sec
Firefox 11 runs
className
3K/s
getComputedStyle
374/s

Fastest: className (7.0x faster)

View exact numbers
  • className: 2,604 ops/sec
  • getComputedStyle: 374 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
    getComputedStyle
    className

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Chrome 138 on Mac OS X 10.15.7
View result in a separate tab
className
22K/s
getComputedStyle
2K/s
View exact numbers
Test name Executions per second
className 21,729 Ops/sec
getComputedStyle 2,053 Ops/sec