Script Preparation code:
AخA
 
data = [...Array(1000)].map((_, id) => ({ id, data: Math.random() }))
map = new Map(data.map(v => [v.id, v]))
Tests:
  • Map.get

     
    const res = map.get(50)
  • Array.find

     
    const res = data.find(({ id }) => id === 50)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Map.get
    Array.find

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/25.0 Chrome/121.0.0.0 Mobile Safari/537.36
Chrome Mobile 121 on Android
View result in a separate tab
Test name Executions per second
Map.get 4531271.5 Ops/sec
Array.find 3236547.5 Ops/sec