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; rv:149.0) Gecko/20100101 Firefox/149.0
Browser:
Firefox 149
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
3 months ago
String()
6.6M/s
concat
6.5M/s
.toString()
6.5M/s
template
2.0M/s
View exact numbers
Test name
Executions per second
✓
String()
6,631,800 Ops/sec
concat
6,483,140 Ops/sec
.toString()
6,454,974 Ops/sec
template
2,017,488 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}`); }