Script Preparation code:
x
 
var i = 0, count = 100000, a;
var map = new Map();
var array = [];
var obj = {};
for (i = 0; i < count; i++) {
  const randomValue = ~~(Math.random() * 100);
  map.set(i, randomValue);
  array.push({id: i, randomValue});
  obj[i] = randomValue;
}
Tests:
  • map

     
    for (i = 0; i < count; i++) {
      a = map.get(i);
    }
  • array

     
    for (i = 0; i < count; i++) {
      a = array.find(el => el.id = i);
    }
  • obj

     
    for (i = 0; i < count; i++) {
      a = obj[i]
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    map
    array
    obj

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/111.0.5563.72 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 111 on iOS 16.3
View result in a separate tab
Test name Executions per second
map 58.5 Ops/sec
array 58.5 Ops/sec
obj 61.2 Ops/sec