Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
json stringify parse vs spread vs structuredClone
(version: 1)
Comparing performance of:
toString vs JSON.stringify vs structured clone
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
function makeTestData() { return { name: "Matheus de Sousa Martins", age: 30, phone: "999999999999" }; }
Tests:
toString
let a = {...makeTestData()}
JSON.stringify
JSON.parse(JSON.stringify(makeTestData()));
structured clone
structuredClone(makeTestData());
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
toString
JSON.stringify
structured clone
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
11 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0
Browser/OS:
Chrome 139 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
toString
60.0M/s
JSON.stringify
3.6M/s
structured clone
603K/s
View exact numbers
Test name
Executions per second
✓
toString
60,005,980 Ops/sec
JSON.stringify
3,567,354 Ops/sec
structured clone
602,609 Ops/sec
Related benchmarks
json stringify vs object tostring
json stringify vs string tostring
json stringify vs object tostring vs String
json stringify vs object tostring AA
json stringify parse vs spread
json stringify vs object tostring 1
Comments
Confirm delete:
Do you really want to delete benchmark?