9.3 Conclusion
In this chapter, we list some tips and tricks about C code efficiency in size and speed. Thanks to the modern C compilers, they are smart in invoking different optimization options automatically in different cases. However, no compiler knows the code better than the developer, so a good coding is always important.
As shown in the examples, optimizing one aspect may have an effect on the other. We need a balance between code size and speed based on our specific needs.
Although we have these tips and tricks for C code optimization, for a better usage of them, a good understanding of the device and compiler you are working on is quite necessary. And definitely there are other skills and methods to optimize the code efficiency in different application cases.