Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
String concatenation vs array join #2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36
Browser:
Chrome 143
Operating system:
Windows
Device Platform:
Desktop
Date tested:
8 months ago
Benchmark engine:
Benchmark.js
String concatentation
1.6M/s
Array join (w/ push)
175K/s
Array join
173K/s
View exact numbers
Test name
Executions per second
✓
String concatentation
1,555,542 Ops/sec
Array join (w/ push)
175,395 Ops/sec
Array join
172,592 Ops/sec
Tests:
String concatentation
let str = ""; for (let i = 0; i < 1000; i++) { str += "String concatenation. "; }
Array join
let arr = []; for (let i = 0; i < 1000; i++) { arr[i] = "String concatenation. "; } str = arr.join("");
Array join (w/ push)
let arr = []; for (let i = 0; i < 1000; i++) { arr.push("String concatenation. "); } str = arr.join("");