Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Access to Proxy vs Object II
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Linux
Device Platform:
Desktop
Date tested:
7 months ago
Test name
Executions per second
Object access
88644384.0 Ops/sec
Proxy access
3194356.2 Ops/sec
Proxy with get handler access
2763644.2 Ops/sec
Proxy with internal value
2124271.5 Ops/sec
Script Preparation code:
const object = { value: 2 }; const proxy = new Proxy(object, {}) const proxyWithHandler = new Proxy(object, { get(target, prop, receiver) { return Reflect.get(target, prop, receiver) }, set(target, prop, value, receiver) { return Reflect.set(target, prop, value, receiver); } }) const proxyWithInternal = new Proxy(object, { value: 2, get(target, prop, receiver) { return this.value; }, set(target, prop, value, receiver) { this.value = value } }) sum = 0;
Tests:
Object access
++object.value
Proxy access
++proxy.value
Proxy with get handler access
++proxyWithHandler.value
Proxy with internal value
++proxyWithInternal.value