Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Test join vs concat string
(version: 1)
Comparing performance of:
concat vs join vs concat 2x vs join 2x
Created:
one year ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
/*your preparation JavaScript code goes here To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/ async function globalMeasureThatScriptPrepareFunction() { // This function is optional, feel free to remove it. // await someThing(); }
Tests:
concat
const sep = ',' const q = 'a' + sep + 'b' + sep + 'c'
join
const arr = ['a', 'b', 'c'] const q2 = arr.join(',')
concat 2x
const sep = ',' const q = 'a' + sep + 'b' + sep + 'c' + 'a' + sep + 'b' + sep + 'c'
join 2x
const arr = ['a', 'b', 'c', 'a', 'b', 'c'] const q2 = arr.join(',')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
concat
join
concat 2x
join 2x
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/134.0.0.0 Safari/537.36
Browser/OS:
Chrome 134 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
concat
129887552.0 Ops/sec
join
9661815.0 Ops/sec
concat 2x
125135880.0 Ops/sec
join 2x
6374048.5 Ops/sec
Related benchmarks:
Spread vs .concat()
Concat vs Spread asdasdasdasdada
array.join vs string literal
stringies
string concat + join vs unshift + join (2)
clsx string concat vs array join
includes vs. word starts with
comparing array creation
Object vs Map MYTEST2137
Comments
Confirm delete:
Do you really want to delete benchmark?