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_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15
Browser:
Safari 26
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
29 days ago
String()
7.7M/s
concat
7.6M/s
.toString()
7.5M/s
template
5.5M/s
View exact numbers
Test name
Executions per second
✓
String()
7,737,034 Ops/sec
concat
7,577,050 Ops/sec
.toString()
7,521,516 Ops/sec
template
5,483,618 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}`); }