Spread vs structuredClone (v2)

Revision 2 of this benchmark created on


Setup

const myData = {
    "width": 1170,
    "height": 2532
};

Test runner

Ready to run.

Testing in
TestOps/sec
structuredClone
const result = structuredClone(myData);
ready
Spread
const result = { ...myData };
ready
Object.assign
const result = Object.assign({}, myData);
ready
JSON
const result = JSON.parse(JSON.stringify(myData));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.