Test name | Executions per second |
---|---|
Obj / Object.entries() | 1494.6 Ops/sec |
Map / spread | 233.8 Ops/sec |
Map / Array.from() | 235.5 Ops/sec |
let obj = {};
for (let i = 0; i < 100000; i++) {
obj[i] = i;
}
let map = new Map();
for (let i = 0; i < 100000; i++) {
map.set(i, i);
}
let map = new Map();
for (let i = 0; i < 100000; i++) {
map.set(i, i);
}