8: Performance
Abstract
This chapter covers C++ features that can affect the performance of your application programming interface (API). In general, you should not warp your API to achieve high performance; always measure performance and target any optimizations at actual bottlenecks. The performance impact of passing arguments as const references and of reducing your #include dependencies is explained. It's shown how naive constant declarations can add weight to your classes, as well as why initialization lists are efficient and where you should declare them. Coverage is provided on memory optimizations so that your APIs map well to modern CPU caching strategies, including variable clustering, bit fields, unions, and size-based types. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access