title: Getters and Setters. Is there performance overhead?
body: <p>I have a Particle System Engine in my C++ project and the particles themselves are just structs of variables with no functions. Currently, each particle (Particle) is updated from its parent class (ParticleSystem) by having its variables accessed directly. E.g.</p>
  
  <pre><code>particle.x += particle.vx;
  </code></pre>
  
  <p>I am however, debating using getters and setters like this:</p>
  
  <p><code>particle.setX( particle.getX()+particle.getVX() );</code></p>
  
  <p>My question is: <em>Is there any performance overhead from calling getters and setters as opposed to just straight up data access?</em></p>
  
  <p>After all, I do have many many particles to update through...</p>