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; rv:153.0) Gecko/20100101 Firefox/153.0
Browser:
Firefox 153
Operating system:
Windows
Device Platform:
Desktop
Date tested:
yesterday
.toString()
4.0M/s
concat
3.9M/s
String()
3.8M/s
template
1.4M/s
View exact numbers
Test name
Executions per second
✓
.toString()
4,010,818 Ops/sec
concat
3,893,603 Ops/sec
String()
3,834,582 Ops/sec
template
1,362,244 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}`); }