also i want to know which one is most prefered by linux programming
professional these days ?
thanks
Profile. Most of these optimizations are just heuristics; there's no
guarantee that one optimization level will be faster/smaller than another.
The downside of -O3 optimizations is that the debugger info can be
obscured. When you step through the program with -O3 optimization in
a debugger, you can bounce around different parts of the program
without any idea of why it is happening. For a debugging environment,
its best to turn up the debug level to -g3 and turn off the
optimizations to -O0.