Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Proxy with Map vs Proxy vs Object vs Map
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Proxy with Map
5003973.5 Ops/sec
Proxy
6764941.0 Ops/sec
Object
7633507.0 Ops/sec
Map
7280077.0 Ops/sec
Script Preparation code:
var baseObject = { exampleProp: "exampleValue" } var baseMap = new Map(); baseMap.set("exampleProp", "exampleValue"); var baseProxy = new Proxy({}, { get(t, prop) { return prop === "exampleProp"? "exampleValue" : null; } }) var baseProxyWithMap = new Proxy({}, { get(t, prop) { return baseMap.get(prop); } }); var buffer = null;
Tests:
Proxy with Map
buffer = baseProxyWithMap.exampleProp
Proxy
buffer = baseProxy.exampleProp
Object
buffer = baseObject.exampleProp
Map
buffer = baseMap.get("exampleProp")