Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Native JS: Array.join strings vs template literals vs String.concat
find the best solution for concatenate strings
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0
Browser:
Firefox 120
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
join
59314.4 Ops/sec
concat
158442.5 Ops/sec
using template literals
3094549.5 Ops/sec
Script Preparation code:
var name = "name"; var id = "id";
Tests:
join
for (let i = 0; i < 80; ++i) { let result = [id, ':', i, ', ', name, ':', 'name', i].join(); }
concat
for (let i = 0; i < 80; ++i) { let result = "".concat(id, ':', i, ', ', name, ':', 'name', i); }
using template literals
for (let i = 0; i < 80; ++i) { let result = `${id}:${i}, ${name}:name${i}`; }