Improving CPU code performance
After establishing a baseline reading, we can begin making changes to our code. Some of these changes involve simply understanding the libraries we're using and being more cautious about the way they're deployed, while others revolve around making better design choices, applying faster and more appropriate algorithms, designing data structures better, and using the newest features of the C++ standard. Let's begin by taking a look at some easy changes that can be made to our code.
Optimizing the three most obvious bottlenecks
Judging by the profiler's results, there is quite a bit of room for improvement of the code we've written so far. In this section, we're going to be addressing three of the most inefficient implementations and how they can be fixed.
GL_Transform optimizations
The very first example we used to illustrate how time sampling works is a perfect candidate for improvement. There really is nothing subtle about it. First, the recalculation of all matrices...