Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Map has vs Object []
(version: 0)
Comparing performance of:
Map has vs Object []
Created:
4 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var map = new Map(); var obj = {}; var i = 1e7; while (i--) { map.set(i, i); obj[i] = i; } var noop = Function.prototype; var s = 0;
Tests:
Map has
i = 1e7; s = 0; while (i--) { if (map.has(i)) s += 1; }
Object []
i = 1e7; s = 0; while (i--) { if (obj[i]) s += 1; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Map has
Object []
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 years ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36
Browser/OS:
Yandex Browser 24 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Map has
0.2 Ops/sec
Object []
0.3 Ops/sec
Related benchmarks:
Array.prototype.map vs Lodash map
Array from() vs Map.keys()
Array.from->map vs Array.prototype.map.call
Array.from().map vs Array.prototype.map.call
Map.prototype.forEach vs Array.prototype.forEach
Comments
Confirm delete:
Do you really want to delete benchmark?