Object access vs Proxy access vs Proxy with get handler access vs Use of simple getter vs Use of definePropertyFastest: Object access (2.1x faster)
14,259,963 ops/sec
13,894,405 ops/sec
13,881,182 ops/sec
13,565,242 ops/sec
6,674,288 ops/sec
Fastest: Use of defineProperty (2.6x faster)
8,233,651 ops/sec
8,203,234 ops/sec
7,856,448 ops/sec
6,613,880 ops/sec
3,114,966 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| Object access | |
| Proxy access | |
| Proxy with get handler access | |
| Use of simple getter | |
| Use of defineProperty |
| Test name | Executions per second |
|---|---|
| ✓ Object access | 178,686,816 Ops/sec |
| Use of simple getter | 171,482,096 Ops/sec |
| Use of defineProperty | 154,738,320 Ops/sec |
| Proxy access | 64,565,580 Ops/sec |
| Proxy with get handler access | 35,373,864 Ops/sec |