Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
array of object destruc vs JSON.parse + JSON.stringify
Checking how does 1 level of objects destruct inside 1 array compared to the JSON.parse(JSON.stringify(data)) hack commonly used to deeply nested objects
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 17
Operating system:
iOS 17.6.1
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
1 level destruct
1899877.5 Ops/sec
Json parse
759585.5 Ops/sec
Tests:
1 level destruct
const original = new Array(10).fill(null).map((_, i) => ({a:i, b:2*i, c: 'hi'})) const des = original.map((item) => ({...item})) des[0].a;
Json parse
const original = new Array(10).fill(null).map((_, i) => ({a:i, b:2*i, c: 'hi'})) const json = JSON.parse(JSON.stringify(original)); json[0].a;