Test name | Executions per second |
---|---|
Object access | 15666077.0 Ops/sec |
Proxy access | 14982360.0 Ops/sec |
Proxy with get handler access | 6009883.5 Ops/sec |
New Proxy with handler | 3119687.0 Ops/sec |
object = { value: 'data' };
proxy = new Proxy(object, {})
getProxyWithHandler = () => new Proxy(object, {
get(target, prop, receiver) {
return Reflect.get(target, prop, receiver)
}
})
proxyWithHandler = getProxyWithHandler()
object.value;
proxy.value
proxyWithHandler.value
getProxyWithHandler().value