Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Proxy vs prototype
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/128.0.0.0 Mobile Safari/537.36 EdgA/128.0.0.0
Browser:
Chrome Mobile 128
Operating system:
Android
Device Platform:
Mobile
Date tested:
4 months ago
Test name
Executions per second
Proxy
35.5 Ops/sec
Prototype
174.5 Ops/sec
Script Preparation code:
const obj = {} var cnt = 100000 for (let i = 0; i < cnt; i++) { obj[i] = i + '' } var proxy = new Proxy(obj, { get(obj, prop, reciever) { return Reflect.get(obj, prop, reciever) } }) var protoObj = Object.create(obj, {})
Tests:
Proxy
for (let i = 0; i < cnt; i++) { proxy[i] }
Prototype
for (let i = 0; i < cnt; i++) { protoObj[i] }