Summary
We have covered a lot of complex material in this chapter. Optimizing code is a difficult but necessary skill for any modern C++ developer. The demands of machine learning, hyper-realistic games, big data analysis, and energy-efficient computing make this a very vital area to learn about for any C++ professional. We have learned that the process of performance optimization is divided into two stages.
Firstly, optimization starts with a proper performance measurement strategy, with test conditions mirroring real-world data and usage patterns. We have learned how to measure performance by various methods – studying assembler code, manual timing, source code instrumentation, and using runtime profilers. Once we have accurate measurements, we can actually understand which portions of our programs are actually slow and focus our efforts there to get the maximum improvements.The second stage involves actually modifying the program – we learned about several strategies, starting...