iphonexcode

Xcode Default Optimization Level?


Can anyone confirm the default options I should be using for compiler optimisation. I remember I changed this whilst Xcode4 was in preview to work round a bug, but now I can't remember what it was set to before (i.e. by default).

I currently have it set to:

Debug: Fastest, Smallest [-Os]
Release: Fastest, Smallest [-Os]

I am pretty sure it should be: (but wanted to check)

Debug: None [-O0]
Release: Fastest, Smallest [-Os]

Solution

  • Yes None -O0.
    With -O1 or greater optimizations, the compiler try to optimize part of the code (loops, instruction swap and others) making it harder to do a step by step debug.