Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
proxy access vs function vs getter
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
baseline property access
2614231.8 Ops/sec
obj with getter
2227298.8 Ops/sec
function access
2214833.5 Ops/sec
proxy access
2392327.5 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function useTest() { const obj = { a: 'something' } const objWGetter = { get a() { return obj.a } } const proxy = new Proxy(obj, { get(target, key) { return target[key] } }) function getA() { return obj.a } return { obj, objWGetter, proxy, getA } }
Tests:
baseline property access
const {obj}=useTest() const a =obj.a
obj with getter
const {objWGetter}=useTest() const a =objWGetter.a
function access
const {getA}=useTest() const a =getA()
proxy access
const {proxy}=useTest() const a =proxy.a