This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Optimization Levels

Why are there several optimization levels as on would always want to optimize the code to maximum?

  • Precisely because there is no single definition of "maximum!"
    It could mean smallest code size, or fastest code execution - usually there is a tradeoff between the two; eg,
    Inline functions produce faster execution, but require more code space!

    There may be particular reasons why certain optimisations are inappropriate in a certain application; eg consider the use of 'volatile'.

    If you look at any Compiler manual, you will see that they all offer a range of Optimisation options - so that you can choose what is actually "optimum" in your particular application.
    Some programmers, familiar with other compilers, would say, "wot? only eight different levels!"