Script Preparation code:
AخA
 
var data = [...Array(10000)].map((_, i) => i);
Tests:
  • Object.fromEntries w/Array.map

     
    Object.fromEntries(data.map(i => [i, i]));
  • Reduce

     
    data.reduce((acc, i) => {
      acc[i] = i;
      return acc;
    }, {});
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object.fromEntries w/Array.map
    Reduce

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15
Safari 15 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Object.fromEntries w/Array.map 9642.3 Ops/sec
Reduce 14014.2 Ops/sec