Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
Firefox 101
Windows
Desktop
2 years ago
Test name Executions per second
style.setProperty 15.9 Ops/sec
style.cssText 41.1 Ops/sec
style 38.1 Ops/sec
Object.assign 15.1 Ops/sec
setAttribute 646.8 Ops/sec
Assign property 16.5 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • style.setProperty

  • style.cssText

  • style

  • Object.assign

  • setAttribute

  • Assign property