Home | Projects | Notes > C Programming > Optimization

Optimization

 

Optimization

Optimization is a series of actions taken by the compiler on your program's code generation process to reduce:

By default, the compiler doesn't invoke any optimization on your program (i.e., Optimization level 0; -O0). Optimization can be enabled by using the compiler optimization flags.

 

Optimization Levels (GCC Compiler Flags)

You need to work with different optimization levels to find out what works best for your situation.

-O0

-O1

-O2

-O3

-Os

 

Effect of Optimization