Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
ts4623
(version: 0)
Comparing performance of:
f1_map vs f2_map vs f1_obj vs f2_obj
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
f1_map
var map = new Map() for(let i=0;i<10000;i++){ const key = i+'_'+i; map.set(key, 'foo'); }
f2_map
var map = new Map() for(let i=0;i<10000;i++){ const key = (i << 16) | i; map.set(key, 'foo'); }
f1_obj
var map = {} for(let i=0;i<10000;i++){ const key = i+'_'+i; map[key] = 'foo' }
f2_obj
var map = {} for(let i=0;i<10000;i++){ const key = (i << 16) | i; map[key] = 'foo'; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
f1_map
f2_map
f1_obj
f2_obj
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Browser/OS:
Firefox 131 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
f1_map
647.3 Ops/sec
f2_map
1883.1 Ops/sec
f1_obj
406.5 Ops/sec
f2_obj
1196.9 Ops/sec
Related benchmarks:
for...in vs Object.keys
for-in vs object.keys v3
Map vs Object creation 3
Access Object, Map, Set
Object vs Map with string key
Map get VS Map has get2
Map.has vs Map.get check if the key exists
Comments
Confirm delete:
Do you really want to delete benchmark?