Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
String() vs .toString() vs String Literal vs String concat
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Browser:
Chrome 136
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
String Literal
7.7M/s
String Concat
7.7M/s
.toString()
2.6M/s
String()
1.3M/s
View exact numbers
Test name
Executions per second
✓
String Literal
7,736,470 Ops/sec
String Concat
7,707,568 Ops/sec
.toString()
2,564,248 Ops/sec
String()
1,297,663 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()); }
String Literal
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(`${num}`); }
String Concat
let num = 500; let nums = []; for(let i = 0; i < 100; ++i) { nums.push(num + ''); }