Re:Python 3.11: “Zero cost” exception handling
by zeotroph on Wednesday October 06, 2021 @12:23PM
(#28774968)
Indeed, in the following case of a 4-deep call stack, each with its own exception, the bulk of the handling code can be moved elsewhere (already marked as cold by the compiler), but nonetheless there are a few instructions which won't matter in most cases but are still required to jump there and thus end up in the instruction cache.
https://godbolt.org/z/eh1d4K1M7