Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Map get VS Map has get 20122
(version: 1)
Map get VS Map has get
Comparing performance of:
Map 1 vs Map 2
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var i = 0, count = 1000, a; var map = new Map(); for (i = 0; i < count; i++) { if (Math.random() > 0.99) { map.set(i, i * i); } }
Tests:
Map 1
for (i = 0; i < count; i++) { a = map.get(i); }
Map 2
for (i = 0; i < count; i++) { if (map.has(i)) { a = map.get(i); } }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Map 1
Map 2
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/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15
Browser/OS:
Safari 17 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Map 1
5338.0 Ops/sec
Map 2
8771.2 Ops/sec
Related benchmarks:
Map get VS Map has get
Map get VS Map has
Map get VS Map has get (fork)
Map get VS Map has get 2
Map get VS Map has get part 2
Map get VS Map has get Agag
Map has VS Map get
Map get VS Map has get!!!
JS Map get VS JS Map has
Comments
Confirm delete:
Do you really want to delete benchmark?