title: Memory comparison, which is faster?
body: <p>I have a 3D vector class. The private variables are defined:</p>
  
  <pre>
  union {
      struct {
          double x;
          double y;
          double z;
      };
      double data[3];
  };
  </pre>
  
  <p>In implementing operator==, which is faster?</p>
  
  <pre>
  return this->x == v.x && this->y == v.y && this->z == v.z;
  </pre>
  
  <p>OR</p>
  
  <pre>
  return memcmp(this->data, v.data) == 0;
  </pre>