cached Intl.NumberFormat vs new Intl.NumberFormat vs toLocaleStringFastest: toLocaleString (562.6x faster)
28,355,172 ops/sec
2,689,250 ops/sec
50,402 ops/sec
Fastest: toLocaleString (28523.6x faster)
955,082,112 ops/sec
1,331,866 ops/sec
33,484 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| cached Intl.NumberFormat | |
| new Intl.NumberFormat | |
| toLocaleString |
| Test name | Executions per second |
|---|---|
| ✓ toLocaleString | 5,495,398 Ops/sec |
| cached Intl.NumberFormat | 2,363,307 Ops/sec |
| new Intl.NumberFormat | 13,140 Ops/sec |