String() vs .toString()Fastest: .toString() (7.5x faster)
1,474,444 ops/sec
197,455 ops/sec
2,639,014 ops/sec
2,480,375 ops/sec
Fastest: .toString() (3.0x faster)
3,025,818 ops/sec
1,001,743 ops/sec
Fastest: .toString() (1.7x faster)
227,437 ops/sec
132,622 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() |
| Test name | Executions per second |
|---|---|
| ✓ .toString() | 1,780,528 Ops/sec |
| String() | 1,133,497 Ops/sec |