It would appear that catching an error is slower that performing a check prior to the error (for example a TryParse). The related questions that prompt this observation are here and here.
Can anyone tell me why this is so - why is it more costly to catch an error that to perform one or many checks of the data to prevent the error?
Basically, it's the unwinding of the stack that's most expensive. Here's a great link: Why are try blocks expensive?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With