Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Compiler Optimizations (http://www.chiefdelphi.com/forums/showthread.php?t=35270)

Robby 22-02-2005 21:36

Compiler Optimizations
 
Has anyone used the compiler optimizations? If so, which have you used? and have you had any problems with them?

I recently ran out of space on the controller, I rewrote quite a bit of code to optimize it, i got rid of all the unnecessary stuff and continued coding. I then ran out of space again. There is very little that i can do to compact my code even further, so i decided to try the compiler optimizations. I managed to get a significant improvement in size, from 99% to 89%, but i was wondering if there is anything i should be aware of, as i have not yet tested the new code on a robot. Is there anything that the compiler does in optimizations that might mess stuff up?

Rickertsen2 22-02-2005 21:42

Re: Compiler Optimizations
 
Quote:

Originally Posted by Robby
Has anyone used the compiler optimizations? If so, which have you used? and have you had any problems with them?

I recently ran out of space on the controller, I rewrote quite a bit of code to optimize it, i got rid of all the unnecessary stuff and continued coding. I then ran out of space again. There is very little that i can do to compact my code even further, so i decided to try the compiler optimizations. I managed to get a significant improvement in size, from 99% to 89%, but i was wondering if there is anything i should be aware of, as i have not yet tested the new code on a robot. Is there anything that the compiler does in optimizations that might mess stuff up?

For FIRST purposes, optimizations don't really present any special problems unless you are doing special things like debugging inline assembly.

Joe Ross 23-02-2005 01:29

Re: Compiler Optimizations
 
if you enable all the compiler optimizations, make sure that anything volatile is declared volatile explicitly. You can get away without it with no optimizations (at least some times), but not with all the optimizations enabled.

I fought that at least a few times this weekend.

Don Reid 23-02-2005 11:26

Re: Compiler Optimizations
 
If you are running short of data space (RAM) be sure to declare the command_list array in commands.h as "rom".

Dave Flowerday 23-02-2005 11:36

Re: Compiler Optimizations
 
Quote:

Originally Posted by Don Reid
If you are running short of data space (RAM) be sure to declare the command_list array in commands.h as "rom".

Probably a good idea even if you're not short on RAM, since it will take up space in FLASH regardless of whether it's declared "rom" or not.


All times are GMT -5. The time now is 04:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi