Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.68
Chrome 112
Windows
Desktop
one year ago
Test name Executions per second
style.setProperty 14.0 Ops/sec
style.cssText 12.5 Ops/sec
style 11.4 Ops/sec
Object.assign 12.8 Ops/sec
setAttribute 165.2 Ops/sec
attributeStyleMap.set 4.7 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • style.setProperty

  • style.cssText

  • style

  • Object.assign

  • setAttribute

  • attributeStyleMap.set


;