Script Preparation code:
x
 
var i = 0, count = 200000, a;
var map = new Map();
for (i = 0; i < count; i++) {
   map.set(i + '_' + '_g' , i);
}
Tests:
  • Map get

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

     
    for (i = 0; i < count; i++) {
      let key = i + '_' + '_g';
      if (map.has(key)) {
        a = map.get(key);
      }
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Map get
    Map has get

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 16_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1
Mobile Safari 16 on iOS 16.4.1
View result in a separate tab
Test name Executions per second
Map get 25.3 Ops/sec
Map has get 20.6 Ops/sec