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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser:
Chrome 126
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
obj.hasOwnProperty
11612.6 Ops/sec
map.get
11641.1 Ops/sec
obj.a
12039.0 Ops/sec
map.has
11551.8 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'); }