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
Jump 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
Test name
Executions per second
join
163202096.0 Ops/sec
JSON.stringify
26623604.0 Ops/sec
simple string concat
161016928.0 Ops/sec
Related benchmarks:
json stringify vs array tostring 2
json stringify vs array join
json stringify vs array tostring vs array join
json stringify vs array join 5k items
json stringify vs array join without parameter
json stringify vs array joinfffff
JSON stringify vs array join 2
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?