Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JSON.stringify(body)
(version: 1)
JSON.stringify(body)
Comparing performance of:
1 vs 2
Created:
8 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
1
const sendApiRequest = async (host, path, body) => { const url = `https://${host}${path}`; const options = { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'd', 'Accept': '*/*' }, body: JSON.stringify(body) }; console.log(options); }; sendApiRequest('a', 'b', 'c');
2
const sendApiRequest = async (host, path, body) => { const url = `https://${host}${path}`; const options = { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'd', 'Accept': '*/*' }, body: typeof string ? body : JSON.stringify(body) }; console.log(options); }; sendApiRequest('a', 'b', 'c');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
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/140.0.0.0 Safari/537.36
Browser/OS:
Chrome 140 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
1
123367.9 Ops/sec
2
119653.5 Ops/sec
Related benchmarks:
Assigning new variable
JS Variable Performance (const vs let vs var)
jl-20250123c
js mul vs pow
URL object vs split to get canonical url
Test direct and destructuring performances
Nested Json stringify speed test
String comp
from vs split
Comments
Confirm delete:
Do you really want to delete benchmark?