Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Proxy vs prototype
(version: 0)
Comparing performance of:
Proxy vs Prototype
Created:
3 years ago
by:
Guest
Jump to the latest result
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] }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Proxy
Prototype
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
4 months ago
)
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/OS:
Chrome Mobile 128 on Android
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Proxy
35.5 Ops/sec
Prototype
174.5 Ops/sec
Related benchmarks:
Proxy vs Object vs Object.setPrototypeOf
Proxy vs prototype vs direct
Proxy vs Proxy reflect vs prototype vs direct
Proxy.get(prop) vs obj[prop]
Comments
Confirm delete:
Do you really want to delete benchmark?