Script Preparation code:
AخA
 
window.m = new Map();
window.o = {};
for (let i = 0; i < 2000; ++i) {
  window.m.set(Math.random(100000) , i);
  window.o[Math.random(100000)] = i;
}
Tests:
  • Map Lookup

     
    for (let i = 0; i < 10000; ++i) {
      if (window.m.get( Math.random(10000)) !== 1) {
      }
    }
  • Object Lookup

     
    for (let i = 0; i < 10000; ++i) {
      if (window.o[Math.random(10000)] !== 1) {
      }
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Map Lookup
    Object Lookup

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
Chrome 112 on Windows
View result in a separate tab
Test name Executions per second
Map Lookup 666.7 Ops/sec
Object Lookup 183.3 Ops/sec