Summary
In this chapter, we explored performance measurements and optimization of the code we created throughout all the chapters of this book.
First, we looked at the basic dos and don’ts of optimization. You should do any optimizations as late as possible and avoid premature optimization at all costs, as it will slow down the development and eventually delay your product. Also, we talked about some basic ideas on how to make code run faster.
Next, we checked our code examples from Chapter 14 for hotspots and bottlenecks on both the CPU and GPU sides. By using a profiling tool, we detected the code parts where the processor spent more time than necessary. RenderDoc helped us to analyze the frames that are sent from the application to the graphics card, and to compare the effects of different variants of the rendering code sent to the GPU.
Finally, two pieces of advice for the optimization process were given. Scaling up the application helps you to find the real bottlenecks...