Run details:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0
Firefox 99
Windows 7
Desktop
2 years ago
Test name Executions per second
style.setProperty 4.1 Ops/sec
style.cssText 8.3 Ops/sec
style replace 7.7 Ops/sec
Object.assign 3.6 Ops/sec
setAttribute 184.0 Ops/sec
style update 4.1 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • style.setProperty

  • style.cssText

  • style replace

  • Object.assign

  • setAttribute

  • style update