title: C++: Performance impact of BIG classes (with a lot of code)
body: <p>I wonder if and how writing "almighty" classes in c++ actually impacts performance.</p>
  
  <p>If I have for example, a class <strong>Point</strong>, with only <strong>uint x; uint y;</strong> as data, and have defined virtually everything that math can do to a point as methods. Some of those methods might be huge. (copy-)constructors do nothing more than initializing the two data members.</p>
  
  <pre><code>class Point
  {
     int mx; int my;
     Point(int x, int y):mx(x),my(y){};
     Point(const Point&amp; other):mx(other.x),my(other.y){};
   // .... HUGE number of methods....
  };
  </code></pre>
  
  <p>Now. I load a big image and create a <strong>Point</strong> for every pixel, stuff em into a vector and <em>use</em> them. (say, all methods get called once)
  This is only meant as a stupid example!</p>
  
  <p>Would it be any slower than the same class without the methods but with a lot of utility functions? I am not talking about virtual functions in any way!</p>
  
  <p>My Motivation for this: I often find myself writing nice and relatively powerful classes, but when I have to initialize/use a ton of them like in the example above, I get nervous.
  I think I shouldn't.</p>
  
  <p>what I think I know is:</p>
  
  <ol>
  <li>Methods exist only once in memory.
  (optimizations aside) </li>
  <li>Allocation
  only takes place for the data
  members, and they are the only thing
  copied.</li>
  </ol>
  
  <p>So it shouldn't matter. Am I missing something?</p>