Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
JSON.parse(JSON.stringify())1 vs structuredClone
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Browser:
Firefox 121
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
JSON
208.8 Ops/sec
structuredClone
441.5 Ops/sec
Script Preparation code:
function createBigObject(depth) { const obj = {}; for (let i = 0; i < 5000; i++) { obj[i + Math.floor(Math.random() * 10000)] = { [Math.random() * 10000]: Math.random() * 10000, }; } return obj; } var bigObj = createBigObject() var clone;
Tests:
JSON
clone = JSON.parse(JSON.stringify(bigObj))
structuredClone
clone = structuredClone(bigObj)