Performance Cost Of ‘try’ in C#

The performance cost of try is very small. The major cost of exception handling is getting the stack trace and other metadata, and that’s a cost that’s not paid until you actually have to throw an exception.

But this will vary by language and implementation. Why not write a simple loop in C# and time it yourself?

Leave a Comment