Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
json stringify vs array join dumb test
(version: 1)
Comparing performance of:
join vs JSON.stringify vs simple string concat
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
function moreData(arr, left) { if(left === 0) return arr; else { arr.push(Math.floor(Math.random() * 256)); return moreData(arr, left - 1); } } function makeTestData() { return moreData([], 4); }
Tests:
join
let asd = "asdasd qwe d";
JSON.stringify
let asd = JSON.stringify("asdasd qwe d");
simple string concat
let asd = "asdasd qwe d" + "zxc" + "qwe";
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
join
JSON.stringify
simple string concat
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser/OS:
Chrome 131 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
join
163.2M/s
simple string concat
161.0M/s
JSON.stringify
26.6M/s
View exact numbers
Test name
Executions per second
✓
join
163,202,096 Ops/sec
simple string concat
161,016,928 Ops/sec
JSON.stringify
26,623,604 Ops/sec
Related benchmarks
json stringify vs array join
json stringify vs array tostring vs array join
json stringify vs array join without parameter
json stringify vs array tostring large obj
json stringify vs array tostring large obj random
Comments
Confirm delete:
Do you really want to delete benchmark?