title: Does try catch in C++ affect performance when not hit
body: <p>I have code where there is a try catch in a function and the function gets hit. 100+ times. The code return early everytime without actually hitting the try catch. Does this affect performance in Visual Studio. I am seeing a performance impact. </p>
  
  <p>My code was :</p>
  
  <pre><code>void foo(int a) {
   if (a &gt; value) {
      return;
   }
   try {
      possibleErrorFunction();
   } catch {
   }
  }
  </code></pre>
  
  <p>I changed it to:</p>
  
  <pre><code>void foo(int a) {
  if (a &gt; value) {
      return;
  }
  bar();
  }
  
  void bar() {
  try {
      possibleErrorFunction();
  } catch {
  }
  }
  </code></pre>
  
  <p>The second code seems about 10 sec faster. Is there any resaonable explanation for this?</p>