title: Resources for Understanding C++ Performance?
body: <p>I'm looking for resources (ideally a book) that will help me gain an in-depth understanding of C++ performance. Here's a little more background:</p>
  
  <p>I write server software with very high throughput requirements and/or low latency requirements. We write in C++; it's not really up for debate at this time. Most of my colleagues seem to have a much better understanding of C++ performance. They have better mental models, so they can tell when a certain bit of code will perform poorly at scale. I lack this understanding, and so I'm looking to improve my mental model.</p>
  
  <p>I am specifically interested in:</p>
  
  <ul>
  <li>Understanding cache effects, and how cache locality due to object layout affects my code's performance. This is the number one issue that seems to be brought up by other members of my team.</li>
  <li>Understanding how memory allocation otherwise affects performance. Should I be using TCMalloc (or other mallocs), and how should I know? How should I tune the various allocation and deallocation parameters?</li>
  <li>How do I know when the overhead from object copying will matter (and therefore should switch to pointers, for example)?</li>
  <li>I'm also generally interested in "optimizations" as long as I have the knowledge as to when to use them.</li>
  </ul>
  
  <p>Things I'm not really interested in:</p>
  
  <ul>
  <li>"High Performance Computing," a term which seems indicate more math/simulation-oriented applications.</li>
  <li>Discussions of C++ performance relative to other languages, since I'm stuck with C++.</li>
  </ul>
  
  <p>As a starting point, anyone know if this book, <a href="https://rads.stackoverflow.com/amzn/click/com/0201379503" rel="noreferrer" rel="nofollow noreferrer">Efficient C++</a>, would fit the bill?</p>