Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
object with define property vs Proxy get
(version: 0)
Comparing performance of:
Proxy vs brand new object
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
Proxy
const queryResults = { a: {}, b: [2, 3, 4], c: 3, d: { a: 1, b: [], }, }; const trackedResults = new Proxy(queryResults, { get(target, prop, receiver) { return Reflect.get(target, prop, receiver); } }); trackedResults.d
brand new object
const queryResults = { a: {}, b: [2, 3, 4], c: 3, d: { a: 1, b: [], }, }; const trackedResults = {}; for (const key of Object.keys(queryResults)) { Object.defineProperty(trackedResults, key, { configurable: false, enumerable: true, get() { return queryResults[key]; }, }); } trackedResults.d
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Proxy
brand new object
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
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/OS:
Chrome 134 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Proxy
24690404.0 Ops/sec
brand new object
1086150.4 Ops/sec
Related benchmarks:
Proxy vs Object vs Object.setPrototypeOf
Access to Proxy vs Object Another one, nother one
get vs proxy get v2
Proxy.get(prop) vs obj[prop]
Plain object access vs Proxy vs Property
Comments
Confirm delete:
Do you really want to delete benchmark?