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:
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.
I am specifically interested in:
- 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.
- 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?
- How do I know when the overhead from object copying will matter (and therefore should switch to pointers, for example)?
- I'm also generally interested in "optimizations" as long as I have the knowledge as to when to use them.
Things I'm not really interested in:
- "High Performance Computing," a term which seems indicate more math/simulation-oriented applications.
- Discussions of C++ performance relative to other languages, since I'm stuck with C++.
As a starting point, anyone know if this book, Efficient C++, would fit the bill?