Let's Make Robots!

Is there such a Thing as a Program Optimizer?

Is there such a Thing as a Program Optimizer?
After you have gotten your program to work fine in what ever language (C for me right now), is there a Second compiler you can put it through that it would search for code that would do the same thing with less code and replace the main code with the shorter code and make things run faster?
It is a silly idea, but it seems it would certainly save some time and be very useful, at least to me.
If they make such an animal, what would it be called?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
I've never used a program optimizer but that doesn't mean they don't exist.  The ammount and type of optimization you can do realy depends uppon what you are wrighting the program for.  If you wrote your program for a microcontroller that has lots of features, make sure you aren't doing something in software that could be done faster in hardware.  I suggest trying to do the optimization yourself, since you know your program much better than an optimizer.  look for the areas you think are slow or wastefull and think of ways to improve them. 
I think there some program optimization tools with some PIC C compilers, I'm not sure though because I don't pay for compilers, I use the free ones. =p

Yes, optimization is standard equipment in todays compilers (like when compiling C to AVR assembler for example), though I don't think that interpreters (like the PICAXE basic interpreter) offer any optimization.

I use C to program my AVR chips and use the free GCC compiler that offers optimization with respect to either execution speed or program size.