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

     
    for (let i = 0; i < 1000; ++i) {
      if (window.m.get('a' + i) !== i) {
        console.log("bad map key");
      }
    }
  • Object Lookup

     
    for (let i = 0; i < 1000; ++i) {
      if (window.o['a' + i] !== i) {
        console.log("bad object key");
      }
    }
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/120.0.0.0 Safari/537.36
Chrome 120 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Map Lookup 5244.6 Ops/sec
Object Lookup 4305.3 Ops/sec