Historically, we have considered exception handling performance to not to be important. The point was that exceptions should be used for exceptional cases handling and thus they should not have significant impact on well behaved applications. However, a new scenario where this is not true has surfaced recently. When a service depends on a resource that is inherently unreliable, for example a computer network, random temporary failures in such a resource can trigger a failure storm in the service and potentially other services that depend on that service. In this case, the performance of the exception handling is very likely an important factor for fast recovery of these services.
Moreover, the fact that such cases would most likely involve async patterns, the exception handling performance issues get amplified by the fact that the exceptions are rethrown on async state transitions.
A customer has reported that JAVA exception handling is about 10 times better on the same hardware (#12892). We also know that native AOT has much better exception handling performance than CoreCLR.
Goals
Historically, we have considered exception handling performance to not to be important. The point was that exceptions should be used for exceptional cases handling and thus they should not have significant impact on well behaved applications. However, a new scenario where this is not true has surfaced recently. When a service depends on a resource that is inherently unreliable, for example a computer network, random temporary failures in such a resource can trigger a failure storm in the service and potentially other services that depend on that service. In this case, the performance of the exception handling is very likely an important factor for fast recovery of these services.
Moreover, the fact that such cases would most likely involve async patterns, the exception handling performance issues get amplified by the fact that the exceptions are rethrown on async state transitions.
A customer has reported that JAVA exception handling is about 10 times better on the same hardware (#12892). We also know that native AOT has much better exception handling performance than CoreCLR.
Goals