views:

1461

answers:

3

I've heard it might be a good idea to turn off "compile for thumb" in an iPhone target's settings to increase performance. I'm having some trouble finding this setting though. Since I couldn't find it in my current project, I decided to make a new one (where I could find and set it), and copy my files over to it (and also update all libs I'm using at the same time).

But now it seems like this setting has disapperad from this new project also. No matter what SDK I choose, simulator or device, the setting will not show up in the target settings! I do seem however to still have a variable called GCC_THUMB_SUPPORT under the category "User-defined" all of the sudden. What is this?

I tried making a new target, but the setting will not show up in that either (not even GCC_THUMB_SUPPORT).

+4  A: 

GCC_THUMB_SUPPORT is the right variable. Just set it to NO to disable THUMB code generation.
A general rule of THUMB is, to disable it if your code is floating point heavy :)
More about that here.

weichsel
+2  A: 

"Compile for Thumb" should be under Target/Get Info/GCC 4.2 - Code Generation. If it's not there (I'd be surprised if it's not), set the user-defined variable.

Keep in mind that this improves performance only under a narrow set of circumstances that you should understand before fiddling with it.

mikestew
+2  A: 

I've found that the compiler settings ("GCC 4.2 - Code Generation", "GCC 4.2 - Language", etc) only show up in the Target info build settings window when the Active SDK is set to Device -- and the "User-defined" category only shows up when the Active SDK is Simulator.

And yes, disabling Thumb compilation can be a big help to performance if you're dealing with lots of floating point math (e.g. floating-point audio processing). Though it's not, of course, an all-purpose magical speed-up (and supposedly Thumb-compiled code can run faster in some situations), so you'll probably only find disabling Thumb useful if your code has that kind of bottleneck.

alex rae