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; Ubuntu; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0
Browser:
Firefox 143
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
7 months ago
Test name
Executions per second
Object access
337329408.0 Ops/sec
Proxy access
4601794.0 Ops/sec
Proxy with get handler access
3195535.8 Ops/sec
Proxy with internal value
7892285.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