2

For .NET Framework, there is this question, but was answered twelve years ago and might be no more relevant in the age of .NET Core.

Did anything change in the exception mechanics of .NET Core? Are exceptions in .NET Core as slow as in .NET Framework?

  • 1
    I would guess it would be too many moving parts to give a full and complete answer to this question. Why do you need to know? The advice still stands, unchanged. Exceptions *are* slower, relative speaking, to non-exception based code, but they are a tool, and as with all tools they can be abused. – Lasse V. Karlsen Feb 17 '20 at 11:12
  • 1
    I feel like the question and answer you linked to is probably going to be a good duplicate link for this question here, because it doesn't actually cite any hard facts about speed of exceptions in .NET Framework. The advice is thus still solid, even if we're now talking .NET Core. – Lasse V. Karlsen Feb 17 '20 at 11:13
  • Agree with Lasse completely. I'd say exceptions are best avoided if you can. As for performance, you need to benchmark your code to determine this for yourself. – DavidG Feb 17 '20 at 11:26

0 Answers0