Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
Shallow copy
8.4M/s
structuredClone
414K/s
View exact numbers
Test name
Executions per second
✓
Shallow copy
8,366,438 Ops/sec
structuredClone
414,438 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)