title: How wasteful would it be to call an empty function?
body: <p>These three points all relate to the same "empty function" question:</p>
  
  <ul>
  <li>How much processing time is wasted when calling an empty function? </li>
  <li>Would it make a huge impact to call 100, or even 1000 empty functions?</li>
  <li>What if these empty functions required arguments? </li>
  </ul>
  
  <p><strong>Important edit</strong> Is  calling an empty virtual function the same?</p>
  
  <hr>
  
  <p><strong>Edit</strong> 
  SO basically you are all saying that in most cases the compiler will optimize this out. </p>
  
  <p>But now I'm curious as this still applies to the question. What if there's a situation like so, where it is not known at compile time when an empty function will be called?
  Will it immediately go to the stack then exit?</p>
  
  <pre><code>class base{
  public:
      virtual void method() = 0;
  };
  
  class derived1: public base{
  public:
      void method() { }
  };
  
  class derived2: public base{
  public:
      void method(){ std::cout &lt;&lt; " done something  "; }
  };
  
  
  int main()
  {
      derived1 D1;
      derived2 D2;
      base* array[] = { &amp;D1, &amp;D2 };
      for( int i = 0; i &lt; 1000; i ++)
      {
          array[0]-&gt;method();// nothing
          array[1]-&gt;method();// Something
      }
      return 0;
  }
  </code></pre>