Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
string concat and array.join
(version: 0)
measure string concats
Comparing performance of:
join vs concat
Created:
2 years ago
by:
Guest
Go to the latest result
Script Preparation code:
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Tests:
join
let result = new Array(length); for (let i = 0; i < length; i++) { result[i] = characters.charAt(Math.floor(Math.random() * characters.length)); } return result.join("");
concat
let result = ""; for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * characters.length)); } return result;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
join
concat
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 years ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Browser/OS:
Chrome 126 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
concat
3.3M/s
join
1.3M/s
View exact numbers
Test name
Executions per second
✓
concat
3,337,261 Ops/sec
join
1,318,814 Ops/sec
Related benchmarks
concat vs plus string
Comments
Confirm delete:
Do you really want to delete benchmark?