Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
json stringify vs String()
(version: 1)
Comparing performance of:
toString vs JSON.stringify
Created:
5 months 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
String(makeTestData())
JSON.stringify
JSON.stringify(makeTestData());
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
toString
JSON.stringify
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0
Browser/OS:
Chrome 145 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
toString
23.1M/s
JSON.stringify
8.7M/s
View exact numbers
Test name
Executions per second
✓
toString
23,138,688 Ops/sec
JSON.stringify
8,721,757 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
boolean json stringify vs object tostring
Comments
Confirm delete:
Do you really want to delete benchmark?