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

Disappointing optimisation...

Hi,

I'm doing a comparison between BL51 and Lx51 to determine the code space savings- I'm a bit suprised to see that for the same project, Lx51 yields a code reduction of only 0.6%- I've enabled the AJMP/ACALL setting, and altered the optimisation levels (speaking of which, under Lx51 raising the optimsation levels from 9 to the 'new' levels of 10/11 actually increases the code size)

Does anyone have any similar experience of this phenomena- or any suggestion as to what else I should try to get the touted 10-15% reductions available using LX51?

I'm only using the 'BANKAREA' LX51 controls...

Thanks

David

Parents
  • That's strange - on all my fairly sizeable projects I see code size reductions of around the percentage Keil claim.

    Do you have 'Favour size' selected?

    "under Lx51 raising the optimsation levels from 9 to the 'new' levels of 10/11 actually increases the code size"

    This has been my experience as well. There have been another couple of threads on this subject, the conclusion seemed to be that optimisation level 9 gives the smallest code.

Reply
  • That's strange - on all my fairly sizeable projects I see code size reductions of around the percentage Keil claim.

    Do you have 'Favour size' selected?

    "under Lx51 raising the optimsation levels from 9 to the 'new' levels of 10/11 actually increases the code size"

    This has been my experience as well. There have been another couple of threads on this subject, the conclusion seemed to be that optimisation level 9 gives the smallest code.

Children
  • "under Lx51 raising the optimsation levels from 9 to the 'new' levels of 10/11 actually increases the code size"

    Me too! Sometimes there is little of no difference and sometimes the code size grows.

  • This was discussed at length a while back - even with some providing size comparison data:

    http://www.keil.com/forum/docs/thread3346.asp

    The results definitely do seem to depend upon the nature of your code...

  • Most of the optimization takes place in the compiler, so BL51 vs LX51 doesn't really say anything about the efficiency of the optimizer.

    Did you turn on "linker code packing", under LX51?

    Turning it on can sometimes reduce code size dramaticly.

  • "Most of the optimization takes place in the compiler, so BL51 vs LX51 doesn't really say anything about the efficiency of the optimizer.

    Did you turn on "linker code packing", under LX51?

    Turning it on can sometimes reduce code size dramaticly."

    That's a bit contradictory, isn't it? Or don't you count linker optimisations as optimisations?

  • "Most of the optimization takes place in the compiler, so BL51 vs LX51 doesn't really say anything about the efficiency of the optimizer."

    I don't care where the optimisation takes place- If using LX51 provides me with two extra levels of optimisation (and a bigger hole in my pocket after buying PK51), I don't think it's unreasonable to expect an overall reduction in code size, especially since, according to Keil:

    "The LX51 has Linker Code Packing which reduces typically code size by 10..15% compared to the maximum optimizations that you can get with BL51"

    I can only assume that our projects are atypical...

  • "I don't care where the optimisation takes place- If using LX51 provides me with two extra levels of optimisation (and a bigger hole in my pocket after buying PK51), I don't think it's unreasonable to expect an overall reduction in code size"

    I agree, although as noted elsewhere the extra two optimisation levels are at best of dubious value. The big saving comes with the code packing jump/call optimisation.

    "I can only assume that our projects are atypical..."

    Maybe - do you have a large amount of constant data or something?