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:
one year ago
by:
Registered User
Go 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:
one month ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Browser/OS:
Firefox 140 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
join
366/s
toString
351/s
string
252/s
stringify
246/s
View exact numbers
Test name
Executions per second
✓
join
366 Ops/sec
toString
351 Ops/sec
string
252 Ops/sec
stringify
246 Ops/sec
Related benchmarks
JSON.stringify array vs join Updated
stringify vs join vs 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?