title: Cache Optimizations for adding 2 long vector
body: <p>Given 2 long vectors 2000 element each are to be added on machine with 32 byte cache line (single level cache) and a CPU. We have to add these 2 vectors such that sum goes in a new vector.<br>
  e.g. <code>c[0]=a[0]+b[0], c[1]=a[1]+b[1], c[2]=a[2]+b[2]......... c[1999]=a[1999]+b[1999]</code></p>
  
  <p>I know when <code>c[0]=a[0]+b[0]</code> is done we will have <code>a[0]to a[31], b[0]to b[31], c[0]to c[31]</code> in cache . So we will get a cache miss at every 32nd element. Somebody asked me this:</p>
  
  <p>Can you optimize it more for getting better performance (over what I stated above. Cache miss only at 32 element because of locality)?</p>
  
  <p>I am sure there is something more to this that I don't know.</p>