Optimization means different things to different people. In some situations, you might simply want your code to run as fast as possible. However, if you're writing code for an embedded system, you might prefer to optimize for code density to reduce your application's memory footprint.

Often these optimization constraints work against each other. For example, loop-unrolling is an optimization technique that can improve performance but this optimization comes at the expense of increased code size. The first step in optimization is deciding what you want to optimize.