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, i + 1]);
    window.o[Math.random(100000)] = [i, i + 1];
}
Tests:
  • Map Lookup

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

     
    for (let i = 0; i < 10000; ++i) {
      if (window.o[Math.random(100000)] !== 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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Map Lookup 270.8 Ops/sec
Object Lookup 81.2 Ops/sec