Know thy exceptions, part 2
(At the time of writing this, I have three comments on the previous article. That is the background to this post) With a modified version of the below application, where I wrap the entire loop into a try-catch-statement instead of every iteration, and multiplying the number of iterations by 100 (for better statistical value), a debug-release generates the following: VB.NET - Debug Build With Try-Catch (100 iterations): 356433 ms Without Try-Catch (100 iterations): 175644 ms Diff: 180790 ms (49%) VB.NET - Debug Build - Single Iteration, 3rd execution With Try-Catch (100 iterations): 4703 ms Without Try-Catch (100 iterations): 1750 ms Diff: 2953 ms (37%) VB.NET - Release Build With Try-Catch (100 iterations): 248033 ms Without Try-Catch (100 iterations): 175517 ms Diff: 72516 ms (71%) VB.NET - Release Build - Single Iteration, 3rd execution With Try-Catch (100 iterations): 2516 ms Without Try-Catch (100 iterations): 1750 ms Diff: 766 ms (70%) C# - Debug Build - coming