I Measured Whether try/catch Still Slows a Hot Loop
Old advice says wrap less code in try/catch because it's slow, so I measured it in Node 22 A 50-million-iteration loop ran in 524.6ms plain and 502.9ms wrapped in try/catch, no real gap Entering a try/catch that never throws cost about 0.002 microseconds per iteration Actually throwing and catching…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-11-15 22:00 · DEV Community — AI
I Measured Whether try/catch Still Slows a Hot Loop