Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Adam Map Test
(version: 0)
Map Test
Comparing performance of:
asd vs asd2
Created:
one year ago
by:
Guest
Jump to the latest result
Tests:
asd
// Create a new Map const myMap = new Map(); // Define 10 objects const obj1 = { name: 'Object 1', value: 1 }; const obj2 = { name: 'Object 2', value: 2 }; const obj3 = { name: 'Object 3', value: 3 }; const obj4 = { name: 'Object 4', value: 4 }; const obj5 = { name: 'Object 5', value: 5 }; const obj6 = { name: 'Object 6', value: 6 }; const obj7 = { name: 'Object 7', value: 7 }; const obj8 = { name: 'Object 8', value: 8 }; const obj9 = { name: 'Object 9', value: 9 }; const obj10 = { name: 'Object 10', value: 10 }; // Add objects to the Map with string keys myMap.set('key1', obj1); myMap.set('key2', obj2); myMap.set('key3', obj3); myMap.set('key4', obj4); myMap.set('key5', obj5); myMap.set('key6', obj6); myMap.set('key7', obj7); myMap.set('key8', obj8); myMap.set('key9', obj9); myMap.set('key10', obj10); // Accessing values console.log(myMap.get('key1')); // Output: { name: 'Object 1', value: 1 } console.log(myMap.get('key10')); // Output: { name: 'Object 10', value: 10 } // Iterating over the Map myMap.forEach((value, key) => { console.log(`${key}: ${JSON.stringify(value)}`); });
asd2
// Create a new Map const myMap = new Map(); // Define 10 objects const obj1 = { name: 'Object 1', value: 1 }; const obj2 = { name: 'Object 2', value: 2 }; const obj3 = { name: 'Object 3', value: 3 }; const obj4 = { name: 'Object 4', value: 4 }; const obj5 = { name: 'Object 5', value: 5 }; const obj6 = { name: 'Object 6', value: 6 }; const obj7 = { name: 'Object 7', value: 7 }; const obj8 = { name: 'Object 8', value: 8 }; const obj9 = { name: 'Object 9', value: 9 }; const obj10 = { name: 'Object 10', value: 10 }; // Add objects to the Map with string keys myMap.set('key1', obj1); myMap.set('key2', obj2); myMap.set('key3', obj3); myMap.set('key4', obj4); myMap.set('key5', obj5); myMap.set('key6', obj6); myMap.set('key7', obj7); myMap.set('key8', obj8); myMap.set('key9', obj9); myMap.set('key10', obj10); // Accessing values console.log(myMap.get('key1')); // Output: { name: 'Object 1', value: 1 } console.log(myMap.get('key10')); // Output: { name: 'Object 10', value: 10 } // Iterating over the Map myMap.forEach((value, key) => { console.log(`${key}: ${JSON.stringify(value)}`); });
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
asd
asd2
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Browser/OS:
Chrome 119 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
asd
17060.5 Ops/sec
asd2
16956.4 Ops/sec
Related benchmarks:
Javascript Map.set undefined vs Map.delete
Map lookup 3
Iterating map v2
Object vs map incrementing
reverse vs map vs toReversed
Comments
Confirm delete:
Do you really want to delete benchmark?