Talking about performance optimization is like talking about pizza. Some people like and search for pizza with pineapple. Others only eat traditional Italian pizzas (or from a specific region). Some only eat vegetarian pizza, while others like all kinds of pizza. The point is, performance optimization is contextual to your code base and your product. What kind of performance are you looking at? What is the most valuable part of performance for your users? And what constraints do you need to take into account?
The customers I work with usually have a few performance requirements, depending on the topic:
- Embedded products (for example, automotive, energy, or telecommunications) often need to work within memory constraints. The stack and the heap are often small, thus limiting the number of long-lived variables. The cost of increasing memory can be prohibitive...