new Intl.DateTimeFormat.format() vs cached Intl.DateTimeFormat.format() vs new Intl.DateTimeFormat.formatToParts vs cached Intl.DateTimeFormat.formatToParts()Fastest: cached Intl.DateTimeFormat.format() (32.0x faster)
944,157 ops/sec
395,325 ops/sec
29,841 ops/sec
29,470 ops/sec
Fastest: cached Intl.DateTimeFormat.format() (40.5x faster)
1,043,725 ops/sec
507,245 ops/sec
25,829 ops/sec
25,758 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| new Intl.DateTimeFormat.format() | |
| cached Intl.DateTimeFormat.format() | |
| new Intl.DateTimeFormat.formatToParts | |
| cached Intl.DateTimeFormat.formatToParts() |
| Test name | Executions per second |
|---|---|
| ✓ cached Intl.DateTimeFormat.format() | 2,403,828 Ops/sec |
| cached Intl.DateTimeFormat.formatToParts() | 946,197 Ops/sec |
| new Intl.DateTimeFormat.formatToParts | 60,430 Ops/sec |
| new Intl.DateTimeFormat.format() | 60,008 Ops/sec |