Using Exceptions throwing in C#. Does it affect a performance?

后端 未结 8 868
余生分开走
余生分开走 2021-01-13 01:58

Basically, the question is: Do the Exceptions in C# affect the performance a lot? Is it better to avoid Exceptions rethrow? If i generate an exception in my code, does it a

8条回答
  •  悲哀的现实
    2021-01-13 02:34

    This is not silly just I've seen it somewhere else also on SO.

    The exceptions occur well, when things are really exceptional. Most of the time you re-throw the exception (may after logging) when there are not many chances of recovering from it. So it should not bother you for normal course of execution of program.

提交回复
热议问题