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
17 days ago
Test name Executions per second
Object.defineProperty 69697.4 Ops/sec
Object.assign (immutable) 5074.5 Ops/sec
Object.assign (mutable) 63578.0 Ops/sec
Object.defineProperty on Proxy 49542.0 Ops/sec
Property direct on Proxy 55574.6 Ops/sec
Direct Object Property 137501.1 Ops/sec
Object.defineProperty with getter and setter 51337.7 Ops/sec
Object.defineProperties (plural) with getter and setter 38619.8 Ops/sec
Object.defineProperty on Proxy with getter and setter 40973.5 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)