Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Map vs Object property check
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
8 months ago
Test name
Executions per second
obj.hasOwnProperty
10069.3 Ops/sec
map.get
10323.3 Ops/sec
obj.a
10590.8 Ops/sec
map.has
10252.5 Ops/sec
Script Preparation code:
var map = new Map(); var obj = {}; var i = 0, count = 1000, a; for (i = 0; i < count; i++) { map.set('a', 5); } for (i = 0; i < count; i++) { obj['a'] = 5; }
Tests:
obj.hasOwnProperty
for (i = 0; i < count; i++) { a = obj.hasOwnProperty('a'); }
map.get
for (i = 0; i < count; i++) { a = map.get('a'); }
obj.a
for (i = 0; i < count; i++) { a = obj.a; }
map.has
for (i = 0; i < count; i++) { a = map.has('a'); }