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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36
Browser:
Chrome 146
Operating system:
Windows
Device Platform:
Desktop
Date tested:
4 months ago
concat
3.3M/s
template
3.3M/s
.toString()
1.1M/s
String()
608K/s
View exact numbers
Test name
Executions per second
✓
concat
3,270,790 Ops/sec
template
3,258,012 Ops/sec
.toString()
1,120,919 Ops/sec
String()
607,578 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}`); }