4 ms·
For the same reason you may want to use or not use memory allocations when doing something 1 time per second or 1 million times per second. Performance is not a
by MauranKilom 5y ago
For the same reason you may want to use or not use memory allocations when doing something 1 time per second or 1 million times per second. Performance is not amenable to arguments about degree (especially when talking about this many orders of magnitude in degree).
- gpderetta 5y agoBut again, the question is whether exceptions need to be slow. If I'm writing a string_to_int function today I would return an optional<int> (or some Either variant). But if exceptions were cheap I would use them. If I'm catching an exception in the context of immediate caller and the compiler inlines the calle, it ought to be able to optimise the exceptional path away. But it doesn't happen.