Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
stringify vs join vs string vs tostring
(version: 1)
Comparing performance of:
stringify vs join vs string vs toString
Created:
11 months ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var arr = Array.from({ length: 10000 }).map((_, i) => [Math.random()*1000, Math.random()*1000]);
Tests:
stringify
arr.map(x => JSON.stringify(x))
join
arr.map(x => x.join(","))
string
arr.map(x => String(x))
toString
arr.map(x => x.toString())
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
stringify
join
string
toString
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
3 months ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
stringify
407.2 Ops/sec
join
291.3 Ops/sec
string
288.8 Ops/sec
toString
263.4 Ops/sec
Related benchmarks:
JSON.stringify array vs join 2
JSON.strigify vs array.join
JSON.stringify array vs join Updated
stringify vs join vs tostring
Join vs toString vs JSON
Test Test Test 1
Stringify array: Array.join / JSON.stringify / Array.toString
args stringify vs join vs toString 2
JSON.stringify array vs map + join (template and concat)
Comments
Confirm delete:
Do you really want to delete benchmark?