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:
9 months ago
by:
Guest
Jump 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:
8 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
Test name
Executions per second
toString
60005980.0 Ops/sec
JSON.stringify
3567354.0 Ops/sec
structured clone
602608.6 Ops/sec
Related benchmarks:
json stringify vs object tostring
json stringify vs int tostring
json stringify vs string tostring
Test String() vs JSON.stringify()
json stringify vs string...
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?