`toFixed` is ~1.6× slower than `Intl.NumberFormat`
With a cached instance, Intl.NumberFormat beats toFixed. If you need locale-aware grouping, you do not have to pay a speed penalty.
Result
| Run | `Number.toFixed(2)` | `Intl.NumberFormat` (2 decimals, cached) | Ratio |
|---|---|---|---|
| Run 1 | 19.985 | 13.241 | 1.51× |
| Run 2 | 24.678 | 14.382 | 1.72× |
| Run 3 | 22.536 | 13.960 | 1.61× |
Conditions
1,000,000 decimal formats (the Intl instance is built once, outside the loop).
Where this number does not apply
Building the Intl instance per call flips the result. If you need no grouping or currency symbol, toFixed is fine.
Reproduce
cd bench
node --expose-gc micro-fixed.mjs --out ../data/run.json --samples 21 Run it three times on the same machine; if the spread of median stays under 10%, you should land on the same conclusion. If your numbers disagree, tell us and we will retract.