Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In .net why is throwing an exception computationally heavy?

Tags:

.net

In .net why is throwing an exception computationally heavy?

like image 468
rid00z Avatar asked Dec 29 '25 07:12

rid00z


1 Answers

Things like computing the full call stack at the exception point take time and computation.

However, there is some places where .NET does better than C++, since it doesn't have to track memory that needs to be cleaned up the same way as a C++ exception handler.

For some more details, I'd recommend Rico Mariani's blog post on this subject.

like image 198
Reed Copsey Avatar answered Jan 01 '26 14:01

Reed Copsey