HTML Preparation code:
Tests:

Historical Performance Data aggregated from 35 community runs

Desktop Results:
Chrome 27 runs
style.display = none
375/s
classList add hide
356/s
View exact numbers
  • style.display = none: 375 ops/sec
  • classList add hide: 356 ops/sec
Firefox 8 runs
classList add hide
352/s
style.display = none
235/s

Fastest: classList add hide (1.5x faster)

View exact numbers
  • classList add hide: 352 ops/sec
  • style.display = none: 235 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
    style.display = none
    classList add hide

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Chrome 149 on Windows
View result in a separate tab
style.display = none
712/s
classList add hide
652/s
View exact numbers
Test name Executions per second
style.display = none 712 Ops/sec
classList add hide 652 Ops/sec