title: efficient check for value change in array of floats in c++
body: <p>i want to optimize an OpenGL application, and one hotspot is
  doing expensive handling ( uploading to graphics card ) of
  relatively small arrays ( 8-64 values ) where sometimes the
  values change but most of the times stay constant. So most
  efficient solution would be to upload the array only when
  it has changed.</p>
  
  <p>Of course the simplest way would be setting flags whenever
  the data is changed, but this would need many code
  changes, and for a quick test i would like to know the
  possible performance gains, before too much work has to
  be done.</p>
  
  <p>So i thought of a quick check ( like a murmur hash etc )
  in memory if the data has changed from frame to frame and
  decide uploding after this check. so the question is, how
  could i eg. XOR an array of values like</p>
  
  <p>float vptr[] = { box.x1,box.y1, box.x1,box.y2, box.x2,box.y2, box.x2,box.y1 };</p>
  
  <p>together to detect reliably value changes?</p>
  
  <p>Best &amp; thanks,
  Heiner</p>