Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ES6 Proxy vs JS Object get/set vs get/set Function
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 131
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Object read/write
4586474.0 Ops/sec
Proxy read/write
1506015.4 Ops/sec
get/set function
4976434.0 Ops/sec
Script Preparation code:
var object = { value: 'foo' }; var proxy = new Proxy(object, { get(target, prop) { return target[prop]; }, set(target, prop, value) { target[prop] = value; } }); function getData(prop) { return object[prop]; } function setData(prop, val) { object[prop] = val; }
Tests:
Object read/write
const val = object.value; object.value = 'bar';
Proxy read/write
const val = proxy.value; proxy.value = 'bar';
get/set function
const val = getData('value'); setData('value', 'bar');