Script Preparation code:
x
 
var objects = []
var maps = []
for (let i = 0; i < 100; i++) {
  const obj = {};
  const map = new Map()
  for (let j = 0; j < 10; j++) {
    const propName = Math.random().toString(36).substr(2, 10); // Generate a random 10-character string
    const propValue = Math.floor(Math.random() * 1000); // Generate a random integer between 0 and 999
    obj[propName] = propValue;
    map.set(propName, propValue);
  }
  objects.push(obj);
  maps.push(map);
}
Tests:
  • Copy objects

     
    const new_objects = objects.map( (obj) => {
      return {...obj}
    })
  • Copy maps

     
    const new_maps = maps.map( (m) => {
      return new Map(m);
    })
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Copy objects
    Copy maps

    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/111.0.0.0 Safari/537.36
Chrome 111 on Windows
View result in a separate tab
Test name Executions per second
Copy objects 50802.9 Ops/sec
Copy maps 15737.3 Ops/sec