title: Performance of pointers in regards to memory cache
body: <p>Consider the following C++ code:</p>
  
  <pre><code>struct Data;
  std::vector&lt;Data&gt; vData;
  std::vector&lt;Data*&gt; vPointers;
  </code></pre>
  
  <p>These two arrays vData and vPointers will be located in two small cache-friendly blocks of memory. </p>
  
  <p>If I ever need to iterate through vPointers, dereference each pointer and access some data members in the original vector, will I incur a cache miss for EVERY iteration of the loop and thus gain a significant loss in performance?</p>
  
  <p>If so, is there an easy way to avoid this?</p>