Script Preparation code:
AخA
 
function createBigObject(depth) {
    const obj = {};
    for (let i = 0; i < 5000; i++) {
        obj[i + Math.floor(Math.random() * 10000)] = {
            [Math.random() * 10000]: Math.random() * 10000,
        };
    }
    return obj;
}
var bigObj = createBigObject()
var clone;
Tests:
  • JSON

     
    clone = JSON.parse(JSON.stringify(bigObj))
  • structuredClone

     
    clone = structuredClone(bigObj)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    JSON
    structuredClone

    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/123.0.0.0 Safari/537.36
Chrome 123 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
JSON 408.6 Ops/sec
structuredClone 454.1 Ops/sec