Script Preparation code:
AخA
 
var data = new Array(1000000).fill(undefined).map((_,i) => i)
var obj = data.reduce((obj, idx) => {obj['idx' + Date.now()] = {name: 'Name: ' + Date.now(), age: idx}; return obj}, {});
var map = new Map(Object.entries(obj));
Tests:
  • Object spread

     
    var copy = {...obj}
  • new Map

     
    var copy = new Map(map)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Object spread
    new Map

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110 on Windows
View result in a separate tab
Test name Executions per second
Object spread 6489.1 Ops/sec
new Map 45678.6 Ops/sec