HTML Preparation code:
Script Preparation code:
Tests:
  • className

  • setAttribute

  • classList

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    className
    setAttribute
    classList

    Fastest: N/A

    Slowest: N/A

Get performance results from real users on your website with Request Metrics.
Latest run results:
Run details: (Test run date: 6 days ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 14_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1
Mobile Safari 14 on iOS 14.1
View result in a separate tab
Test name Executions per second
className 8551.5 Ops/sec
setAttribute 6851.0 Ops/sec
classList 6098.9 Ops/sec

Recommended literature: