Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Shallow copy vs structuredClone
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0
Browser:
Firefox 135
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Shallow copy
8366438.0 Ops/sec
structuredClone
414438.5 Ops/sec
Script Preparation code:
var MyObject = { string: 'string', number: 123456789, boolean: true, obj: { stringify: 'string', number: '123456789' } }; var copied = undefined;
Tests:
Shallow copy
copied = { ...MyObject }
structuredClone
copied = structuredClone(MyObject)