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:
one year ago
by:
Guest
Jump 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:
one year 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
Test name
Executions per second
join
1318814.4 Ops/sec
concat
3337260.8 Ops/sec
Related benchmarks:
String Concatenation
string concat speed
concat vs plus string
array.join vs string literal vs string concatenation
String concatenation vs array join258
Comments
Confirm delete:
Do you really want to delete benchmark?