Script Preparation code:
AخA
 
var obj = {a: "hello", c: "test", po: 33, arr: [1, 2, 3, 4], anotherObj: {a: 33, str: "whazzup"}};
Tests:
  • JSON stringify and parse

     
    const obj1 = JSON.parse(JSON.stringify(obj));
  • structuredClone

     
    const obj2 = structuredClone(obj);
  • Destructuring and Restructuring

     
    const obj3 = { ...obj };
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    JSON stringify and parse
    structuredClone
    Destructuring and Restructuring

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0
Firefox 127 on Windows
View result in a separate tab
Test name Executions per second
JSON stringify and parse 1155466.2 Ops/sec
structuredClone 692880.2 Ops/sec
Destructuring and Restructuring 15998959.0 Ops/sec