String() vs .toString() vs concat vs templateFastest: concat (6.3x faster)
5,352,386 ops/sec
5,349,708 ops/sec
1,604,912 ops/sec
848,886 ops/sec
Fastest: .toString() (3.5x faster)
4,139,128 ops/sec
3,828,662 ops/sec
3,614,190 ops/sec
1,186,858 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| String() | |
| .toString() | |
| concat | |
| template |
| Test name | Executions per second |
|---|---|
| ✓ .toString() | 4,010,818 Ops/sec |
| concat | 3,893,603 Ops/sec |
| String() | 3,834,582 Ops/sec |
| template | 1,362,244 Ops/sec |