Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
Object
7.6M/s
Map
7.3M/s
Proxy
6.8M/s
Proxy with Map
5.0M/s
View exact numbers
Test name
Executions per second
✓
Object
7,633,507 Ops/sec
Map
7,280,077 Ops/sec
Proxy
6,764,941 Ops/sec
Proxy with Map
5,003,974 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")