Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
String() vs .toString() vs concat
(version: 3)
Comparing performance of:
String() vs .toString() vs concat vs template
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var num = 500;
Tests:
String()
String(num)
.toString()
num.toString()
concat
''+num
template
`${num}`
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
String()
.toString()
concat
template
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
String()
96098104.0 Ops/sec
.toString()
84922416.0 Ops/sec
concat
153950336.0 Ops/sec
template
159428528.0 Ops/sec
Related benchmarks:
toString vs concatonate
String() vs template literal
string concatenation vs template
number to string: template literal vs toString vs string literal concat vs string constructor
Concatenation vs Template String
interpolation vs toString vs concat
number to string: template literal vs toString vs string literal concat vs string constructor(2)
Comments
Confirm delete:
Do you really want to delete benchmark?