Script Preparation code:
x
 
var map = new Map([[1, 1]]);
var obj = {1: 1};
var count = 100; 
var a, i;
for (let j = 0; j < count; j++) {
  map.set(j, j);
  obj[j] = j;
}
Tests:
  • Obj get

     
    for (i = 0; i < count; i++) {
      a = obj[i];
    }
  • Map get

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

     
    for (i = 0; i < count; i++) {
      a = map.has(i)
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Obj get
    Map get
    Map has

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: yesterday)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Mobile Safari/537.36
Chrome Mobile 135 on Android
View result in a separate tab
Test name Executions per second
Obj get 19743.4 Ops/sec
Map get 18443.8 Ops/sec
Map has 18825.8 Ops/sec