title: optimizing `std::vector operator []` (vector access) when it becomes a bottleneck
body: <p>gprof says that my high computing app spends 53% of its time inside <code>std::vector &lt;...&gt; operator [] (unsigned long)</code>, 32% of which goes to one heavily used vector. Worse, I suspect that my parallel code failing to scale beyond 3-6 cores is due to a related memory bottleneck. While my app does spend a lot of time accessing and writing memory, it seems like I should be able (or at least try) to do better than 52%. Should I try using dynamic arrays instead (size remains constant in most cases)? Would that be likely to help with possible bottlenecks? </p>
  
  <p>Actually, my preferred solution would be to solve the bottleneck and leave the vectors as is for convenience. Based on the above, are there any likely culprits or solutions (tcmalloc is out)? </p>