Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Map perf has vs get test
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Windows
Device Platform:
Desktop
Date tested:
4 days ago
Test name
Executions per second
Check: has
10492.6 Ops/sec
Check: get
9218.0 Ops/sec
Check: get !!
9340.6 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const d1 = new Map(); for (let i = 0; i < 10000; i++) { d1.set(i, i + 1); // to remove 0 for get } const d2 = new Map(); for (let i = 0; i < 10000; i++) { d2.set(i, i + 1); // to remove 0 for get } const d3 = new Map(); for (let i = 0; i < 10000; i++) { d3.set(i, i + 1); // to remove 0 for get }
Tests:
Check: has
let v1 = 0; for (let i1 = 0; i1 < 10000; i1++) { if (d1.has(i1)) { v1++; } }
Check: get
let v2 = 0; for (let i2 = 0; i2 < 10000; i2++) { if (d2.get(i2)) { v2++; } }
Check: get !!
let v3 = 0; for (let i3 = 0; i3 < 10000; i3++) { if (!!d3.get(i3)) { v3++; } }