Chapter 15. Performance
This chapter covers
- Writing inline functions
- Restricting pointers
- Measuring and inspecting performance
Once you feel more comfortable when coding in C, you will perhaps be tempted to do complicated things to “optimize” your code. Whatever you think you are optimizing, there is a good chance you will get it wrong: premature optimization can do a great deal of harm in terms of readability, soundness, maintainability, and so on. Knuth [1974] coined the following phrase that should be your motto for this whole level:
Takeaway D
Premature optimization is the root of all evil.
Its good performance is often cited as one of the main reasons C is used so widely. While there is some truth to the idea that ...
Get Modern C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.