split vs Date toLocaleString without date being cached vs slice vs substring vs Intl no format cache no date cache vs Intl no format cache with date cache vs Intl with format cache no date cache vs Intl with format cache with date cache vs Date toLocaleString with date being cached| Test case name | Result |
|---|---|
| split | |
| Date toLocaleString without date being cached | |
| slice | |
| substring | |
| Intl no format cache no date cache | |
| Intl no format cache with date cache | |
| Intl with format cache no date cache | |
| Intl with format cache with date cache | |
| Date toLocaleString with date being cached |
| Test name | Executions per second |
|---|---|
| ✓ substring | 733,038,336 Ops/sec |
| slice | 676,450,816 Ops/sec |
| split | 9,663,759 Ops/sec |
| Intl with format cache with date cache | 394,238 Ops/sec |
| Intl with format cache no date cache | 322,170 Ops/sec |
| Intl no format cache with date cache | 6,547 Ops/sec |
| Intl no format cache no date cache | 6,414 Ops/sec |
| Date toLocaleString with date being cached | 5,870 Ops/sec |
| Date toLocaleString without date being cached | 5,636 Ops/sec |