Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
traditional string concat vs template string concat + array join
(version: 1)
Comparing performance of:
traditional string concat vs template string concat vs Array join
Created:
9 months ago
by:
Guest
Jump to the latest result
Script Preparation code:
const a = Math.random(); const b = Math.random(); const c = Math.random(); const d = Math.random(); const arr = [a, b, c, d];
Tests:
traditional string concat
let str = ''; for (let i = 0; i < 1000; i++) { str = a + ',' + b + ',' + c + ',' + d }
template string concat
const str = `${a},${b},${c}${d}`;
Array join
const str = arr.join(",")
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
traditional string concat
template string concat
Array join
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
9 months ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser/OS:
Chrome 136 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
traditional string concat
12610.8 Ops/sec
template string concat
61055428.0 Ops/sec
Array join
3830648.0 Ops/sec
Related benchmarks:
String.prototype.concat vs Array.prototype.join
String() vs .toString() vs template string vs concat with string
Concatenate random strings with + vs template literals vs String.concat
String concatenation vs concat method
Template vs string concat 2
template literal vs array.join vs string.concat vs the + operator
【JiangNanGame】traditional string concat vs template string concat
Native JS: concatenate integer with string with + vs template literals vs String.concat
traditional string concat vs template string concat + array join fixed
Comments
Confirm delete:
Do you really want to delete benchmark?