Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String() vs .toString() vs Concatenation vs Template string
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/133.0.0.0 Safari/537.36
Browser:
Chrome 133
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Template string
5.0M/s
Concatenation
4.9M/s
.toString()
1.4M/s
String()
771K/s
View exact numbers
Test name
Executions per second
✓
Template string
4,955,924 Ops/sec
Concatenation
4,920,070 Ops/sec
.toString()
1,429,108 Ops/sec
String()
770,671 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()); }
Concatenation
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(''+num); }
Template string
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(`${num}`); }