-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
The C++ Programmer's Mindset
By :
Performance is important in code. A solution to a problem is only useful if it executes in a timely fashion and delivers results quickly enough. One of the main reasons for selecting C++ as a language for implementing solutions is that you want to maximize the speed and throughput of your code. Before performing any kind of optimization, one must always measure carefully and focus only on the functions and sections that need to be fast; prematurely optimizing can introduce a lot of complications without doing anything to improve the performance.
In this chapter, we look at one of the tools one can use to inspect the runtime characteristics of a program and identify the parts of the code that need to be as fast as possible. This tool also helps to identify potential reasons why our code is not performing as well as needed, such as a high percentage of cache misses, branch mispredictions, or problems decoding and enqueuing instructions. The basic tool we use...