Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String() vs .toString() vs concat vs template
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser:
Chrome 141
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
7 months ago
concat
4.5M/s
String()
4.4M/s
template
4.4M/s
.toString()
1.0M/s
View exact numbers
Test name
Executions per second
✓
concat
4,463,038 Ops/sec
String()
4,443,922 Ops/sec
template
4,433,118 Ops/sec
.toString()
1,001,045 Ops/sec
Tests:
String()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(String(num)); }
.toString()
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(num.toString()); }
concat
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(num + ""); }
template
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(`${num}`); }