Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
{} vs Map with set
(version: 2)
Comparing performance of:
Creation: Object vs Creation: Map
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
Creation: Object
const n = []; for (let i = 0; i < 10000; i++) { const v = {}; v.i = i; n.push(v); }
Creation: Map
const n = []; for (let i = 0; i < 10000; i++) { const v = new Map(); v.set('i', i); n.push(v); }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Creation: Object
Creation: Map
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:136.0) Gecko/20100101 Firefox/136.0
Browser/OS:
Firefox 136 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Creation: Object
14045.2 Ops/sec
Creation: Map
2852.9 Ops/sec
Related benchmarks:
Map.get vs Object[i] vs Map.has
Map.set() vs Object assignment in loops
Map vs Object creation 3
Set Vs Map Vs Object
Object vs Map with string key
Map vs Object - Write
{} vs Map Creation
{} vs Map with set ONLY
{} vs Map with set and DELETE
Comments
Confirm delete:
Do you really want to delete benchmark?