Chapter 10: Compiler Optimizations in C++
In the last chapter, we have learned about the major sources of inefficiency in C++ programs. The burden of removing these inefficiencies mostly falls on the programmer. However, there is also much that can be done by the compiler to make your programs faster. That is what we are going to explore now.
This chapter will cover the very important matter of compiler optimizations and how the programmer can help the compiler to generate more efficient code.
In this chapter, we're going to cover the following main topics:
- How the compilers approach optimizing the code
- Restrictions on compiler optimization
- How to get the best optimizations from the compiler