Object access vs Proxy access vs Proxy with get handler access vs Use of simple getter vs Use of defineProperty vs Proxy with get reflect handler accessFastest: Use of simple getter (5.8x faster)
101,664,312 ops/sec
98,316,736 ops/sec
78,513,064 ops/sec
32,807,762 ops/sec
23,852,538 ops/sec
17,665,622 ops/sec
Fastest: Use of defineProperty (70.2x faster)
1,252,095,744 ops/sec
1,248,333,568 ops/sec
745,193,600 ops/sec
232,262,944 ops/sec
18,917,216 ops/sec
17,846,580 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 | |
| Proxy with get reflect handler access |
| Test name | Executions per second |
|---|---|
| ✓ Use of simple getter | 131,628,720 Ops/sec |
| Object access | 125,948,680 Ops/sec |
| Use of defineProperty | 122,341,152 Ops/sec |
| Proxy access | 47,683,156 Ops/sec |
| Proxy with get handler access | 33,231,332 Ops/sec |
| Proxy with get reflect handler access | 17,665,622 Ops/sec |