Script Preparation code:
AخA
 
var myObject = {
    name: 'Jane Darlene',
    age: 25,
    score: 120,
    weight: 65.5,
    balabnce: 2000.0,
    premium: false,
    birthDate: '2024-10-02T03:23:58.663Z',
    testNull: null,
    title: 'Some other title',
    description: 'Some other description',
    address: {
        street: '123 Main St',
        city: 'Anytown',
        state: 'NY',
        zip: 12345,
        country: 'USA',
    },
    additionalAddresses: [{
            street: '456 Elm St',
            city: 'Anytown',
            state: 'NY',
            zip: 12345,
            country: 'USA',
        },
        {
            street: '789 Oak St',
            city: 'Anytown',
            state: 'NY',
            zip: 12345,
            country: 'USA',
        },
    ],
    profile: {
        firstName: 'Jane',
        lastName: 'Darlene',
    },
    features: ['One', 'Two', 'Three'],
    favorites: [{
            slug: 'first',
            postname: 'First post'
        },
        {
            slug: 'second',
            postname: 'Second post'
        },
    ],
    todos: {
        1: {
            id: 1,
            text: 'First todo',
            done: false
        },
        2: {
            id: 2,
            text: 'Second todo',
            done: true
        },
    },
};
Tests:
  • structuredClone(myObject)

     
    structuredClone(myObject);
  • JSON.parse(JSON.stringify(myObject))

     
    JSON.parse(JSON.stringify(myObject));
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    structuredClone(myObject)
    JSON.parse(JSON.stringify(myObject))

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131 on Windows
View result in a separate tab
Test name Executions per second
structuredClone(myObject) 33920.0 Ops/sec
JSON.parse(JSON.stringify(myObject)) 45901.5 Ops/sec