Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Map Value Iteration
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
map.values()
10853819.0 Ops/sec
values array
23785446.0 Ops/sec
entries array
17294300.0 Ops/sec
values.values()
23869054.0 Ops/sec
values length-based
15343110.0 Ops/sec
Script Preparation code:
var map = new Map(Object.entries({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10, k: 11, l: 12, m: 13, n: 14, o: 15, p: 16, q: 17, r: 18, s: 19, t: 20, u: 21, v: 22, w: 23, x: 24, y: 25, z: 26 })); var values = Array.from(map.values()); var entries = Array.from(map.entries());
Tests:
map.values()
let total = 0; for(const i of map.values()) total += i;
values array
let total = 0; for(const i of values) total += i;
entries array
let total = 0; for(const [k, i] of entries) total += i;
values.values()
let total = 0; for(const i of values.values()) total += i;
values length-based
let total = 0; const length = values.length; for(let i = 0; i < length; i++) total += values[i];