Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0
Firefox 102
Linux
Desktop
2 years ago
Test name Executions per second
style.setProperty 15.5 Ops/sec
style.cssText 37.7 Ops/sec
style 35.5 Ops/sec
Object.assign 14.9 Ops/sec
setAttribute 332.1 Ops/sec
Assign property 16.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • style.setProperty

  • style.cssText

  • style

  • Object.assign

  • setAttribute

  • Assign property