Is This a Sufficient Demonstration of the Effects of Exception Handling We have some developers in house that believe it is best practice to use exception handing as flow control, as well as, thinking that catching and re-throwing exceptions is effective error handling.  

In an effort to educated, I attempted to come up with a simple sample to demonstrate to them the negative effects of doing so.  The code sample below is what I came up with.  It consistently demonstrates that there is a penalty for gratuitous usage of try/catch blocks; but the effect is much greater than I had anticipated.  I can't help but think I've done something very wrong in this sample.  I would appreciate any suggestions of improvement.

In this sample, I am comparing the cost of catching and re-throwing an exception with just allowing the exception to bubble up.  I needed to execute the methods in parallel to avoid waiting days for the code to execute on high values.

    static void Main(string[] args)
    {
        TimeSpan ts1 = new TimeSpan();
        TimeSpan ts2 = new TimeSpan();
        List&lt;Task&gt; tasks = new List&lt;Task&gt;();

        for (int i = 0; i &lt; 100; ++i)
        {
            Task a = new Task(() =&gt;
            {
                Stopwatch watch1 = new Stopwatch();
                watch1.Start();
                function1(function2);
                watch1.Stop();
                ts1 += watch1.Elapsed;
            });
            a.Start();
            tasks.Add(a);

            Task b = new Task(() =&gt;
            {
                Stopwatch watch2 = new Stopwatch();
                watch2.Start();
                function1(function3);
                watch2.Stop();
                ts2 += watch2.Elapsed;
            });
            b.Start();
            tasks.Add(b);
        }

        while (!tasks.All(t =&gt; t.IsCompleted)) ;
        Console.WriteLine("Watch1: " + ts1);
        Console.WriteLine("Watch2: " + ts2);
        Console.ReadLine();
    }

    static void function1(Action action)
    {
        try
        {
            action();
        }
        catch
        {
        }
    }

    static void function2()
    {
        try
        {
            int.Parse(null);
        }
        catch
        {
            throw;
        }
    }

    static void function3()
    {
        int.Parse(null);
    }
The while loop you are using is impacting performance.  Sleep that check a bit beforehand to give your scenarios some time to think.  

do { Thread.Sleep(3000); } while (!tasks.All(t =&gt; t.IsCompleted));


You may want to suggest some best practices reading to your team, throwing an exception should be reserved for an exceptional circumstance.  Use of the throw for rethrowing an exception is correct to keep the stack trace information complete, but again, should be seldom and when they do finally bubble up to the top, the exception information should be captured in a way that they are not just ignored.

http://www.codeproject.com/KB/architecture/exceptionbestpractices.aspx

https://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c

http://www.codethinked.com/how-do-you-deal-with-exceptions