Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15
Safari 18
Mac OS X 10.15.7
Desktop
18 days ago
Test name Executions per second
Object.defineProperty 64634.0 Ops/sec
Object.assign (immutable) 5015.4 Ops/sec
Object.assign (mutable) 58918.1 Ops/sec
Object.defineProperty on Proxy 25034.6 Ops/sec
Property direct on Proxy 85356.2 Ops/sec
Direct Object Property 109516.1 Ops/sec
Object.defineProperty with getter and setter 44973.5 Ops/sec
Object.defineProperties (plural) with getter and setter 35764.2 Ops/sec
Object.defineProperty on Proxy with getter and setter 21939.8 Ops/sec
Script Preparation code:
Tests:
  • Object.defineProperty

  • Object.assign (immutable)

  • Object.assign (mutable)

  • Object.defineProperty on Proxy

  • Property direct on Proxy

  • Direct Object Property

  • Object.defineProperty with getter and setter

  • Object.defineProperties (plural) with getter and setter

  • Object.defineProperty on Proxy with getter and setter

  • Object.assign on Proxy (mutable)