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
Go 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
f2_map
2K/s
f2_obj
1K/s
f1_map
647/s
f1_obj
406/s
View exact numbers
Test name
Executions per second
✓
f2_map
1,883 Ops/sec
f2_obj
1,197 Ops/sec
f1_map
647 Ops/sec
f1_obj
406 Ops/sec
Related benchmarks
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?