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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Browser:
Chrome 148
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 months ago
concat
4.0M/s
template
3.7M/s
.toString()
1.3M/s
String()
802K/s
View exact numbers
Test name
Executions per second
✓
concat
4,024,026 Ops/sec
template
3,658,920 Ops/sec
.toString()
1,319,141 Ops/sec
String()
801,541 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}`); }