Perhaps you could try the C compiler options -O2 -s to make the compiler perform some optimizations, but not too much, and strip debugging information from the output executable program to make it smaller. Higher levels of optimization can actually cause a program to run slower by increasing the program size, due to loop unrolling, function inlining, and other size-increasing optimizations, causing code to overflow the instruction cache. I am not sure if -s will have any effect on the execution speed, but it will at least make the executable program occupy less disk space / flash memory space.