Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Mobile/15E148 Safari/604.1
Mobile Safari 18
iOS 18.1.1
Mobile
17 days ago
Test name Executions per second
Object.defineProperty 41913.6 Ops/sec
Object.assign (immutable) 3587.2 Ops/sec
Object.assign (mutable) 38563.9 Ops/sec
Object.defineProperty on Proxy 30726.3 Ops/sec
Property direct on Proxy 27910.9 Ops/sec
Direct Object Property 77882.5 Ops/sec
Object.defineProperty with getter and setter 33173.2 Ops/sec
Object.defineProperties (plural) with getter and setter 24756.2 Ops/sec
Object.defineProperty on Proxy with getter and setter 28366.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)