4 ms·
> Also, try/catch will never compile in the JIT. If this is an actual concern (as in you have measured and try/catch is actually affecting something performanc
by eyelidlessness 3y ago
> Also, try/catch will never compile in the JIT.
If this is an actual concern (as in you have measured and try/catch is actually affecting something performance sensitive): you can most likely mitigate the impact by isolating the try/catch bodies in separate functions.
I haven’t verified this in every JIT, but I saw meaningful perf improvement in V8 for real world degenerate cases where the performance did actually matter and make a significant difference. But seriously, as always, measure before optimizing stuff like this! It might matter, but it seldom will for anything more than academic curiosity.