Test name | Executions per second |
---|---|
Array access | 59278932.0 Ops/sec |
Proxy access | 6528805.0 Ops/sec |
Proxy with reflect handler | 2841743.0 Ops/sec |
Proxy with handler | 4109225.8 Ops/sec |
object = ['data'];
proxy = new Proxy(object, {})
proxyWithHandler = new Proxy(object, {
get(target, prop, receiver) {
return Reflect.get(target, prop, receiver)
}
})
proxyWithHandler2 = new Proxy(object, {
get(target, prop, receiver) {
return target[prop]
}
})
object[0];
proxy[0]
proxyWithHandler[0]
proxyWithHandler2[0]