Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
8FAD4EC8-45FE-4D39-A75A-9CC42D9F63D4
(version: 1)
Comparing performance of:
interpolation vs .toString() vs String() vs JSON.stringify()
Created:
2 months ago
by:
Guest
Jump to the latest result
Tests:
interpolation
const n = 123_456_7890; `${n}`;
.toString()
const n = 123_456_7890; n.toString();
String()
const n = 123_456_7890; String(n);
JSON.stringify()
const n = 123_456_7890; JSON.stringify(n);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
interpolation
.toString()
String()
JSON.stringify()
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
2 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36 Edg/145.0.0.0
Browser/OS:
Chrome 145 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
interpolation
134585424.0 Ops/sec
.toString()
77573144.0 Ops/sec
String()
78372832.0 Ops/sec
JSON.stringify()
26782682.0 Ops/sec
Related benchmarks:
test empty object
String Concat vs JSON.stringify 2
json stringify vs array tostring2
String += vs JSON.stringify
json parse vs manual
json parse vs manual 3
Stringify array: Array.join / JSON.stringify / Array.toString
json stringify vs object tostring number thresholds
Loop Comprasion
Comments
Confirm delete:
Do you really want to delete benchmark?