Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Deep copy comparison gil
Benchmarks for StackOverflow question on deep copy techniques https://stackoverflow.com/questions/7486085/copy-array-by-value/23536726#23536726
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
spread ...
33551980.0 Ops/sec
JSON.parse(JSON.stringify())
809628.0 Ops/sec
structuredClone()
613758.5 Ops/sec
Tests:
spread ...
const arr1 = {"in":1,"inT":1716588594541,"keep":1,"kind":4,"lastEvtT":1716588594541,"name":"gil","oTips":{"amt":1,"stta":1,"count":1,"lastT":1716588594541,"amtEver":1},"outT":1716588594541,"sex":"m","spanT":0}; const arr2 = { ...arr1 };
JSON.parse(JSON.stringify())
const arr1 = {"in":1,"inT":1716588594541,"keep":1,"kind":4,"lastEvtT":1716588594541,"name":"gil","oTips":{"amt":1,"stta":1,"count":1,"lastT":1716588594541,"amtEver":1},"outT":1716588594541,"sex":"m","spanT":0}; const arr2 = JSON.parse(JSON.stringify(arr1));
structuredClone()
const arr1 = {"in":1,"inT":1716588594541,"keep":1,"kind":4,"lastEvtT":1716588594541,"name":"gil","oTips":{"amt":1,"stta":1,"count":1,"lastT":1716588594541,"amtEver":1},"outT":1716588594541,"sex":"m","spanT":0}; const arr2 = structuredClone(arr1);