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

EFFECT OF INBUILT OPTIMIZATION LEVELS IN CX51

Hi all,

I am using Keil version "Vision3v3.53". It has 10(0-9) levels of optimization during compiling.
I am working on a project where requirement is to reduce the code size. In default settings when i compile code, the code size comes around 62k and when i use optimization options the code side reduces as per my requirement.
When i use the 9th level optimization option i.e. COMMON BLOCK SUBROUTINES, the code size comes to around 49k.
Now my query is...

Is there any side effect of using these optimization level? If so what can be that effect?
which level of optimization i can use so that it doesn't has any side effect on code.
Also if any one knows better optimization(in terms of code size) technique then this, please suggest me...

Thanks in Advance.
Antriksh

Parents
  • Also if any one knows better optimization(in terms of code size) technique then this, please suggest me...

    "hand optimizing" may give great results.
    make sure nothing that fit in 8 bits use more
    carefully locate variables so that most frequently used are in DATA and rarely used variables in XDATA
    avoid the large memory model

    the above has, as opposed to tool optimizing above level 2 no effect on debugging.

    it is very 'easy' to ignore all concern "I use the 'large' model because it saves me a lot of work" "I always use 'int' that saves me evaluating sizes" etc will cost you more than the optimizer can get back.

    Erik

Reply
  • Also if any one knows better optimization(in terms of code size) technique then this, please suggest me...

    "hand optimizing" may give great results.
    make sure nothing that fit in 8 bits use more
    carefully locate variables so that most frequently used are in DATA and rarely used variables in XDATA
    avoid the large memory model

    the above has, as opposed to tool optimizing above level 2 no effect on debugging.

    it is very 'easy' to ignore all concern "I use the 'large' model because it saves me a lot of work" "I always use 'int' that saves me evaluating sizes" etc will cost you more than the optimizer can get back.

    Erik

Children