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. ...
Get API Design for C++, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.