xcode build optimizations

Member
Posts: 194
Joined: 2009.02
Post: #1
I was fooling around with xcode's build setting's and to my surprise I got around a 15% overall speed improvement by selecting the unroll loops setting. Anyone know of any other build settings which give tangible speed improvements(I would try them all myself but with the build time required for each change it would take me forever).

Also the setting "relax ieee compliance gave me around a 15% increase as well, are there any adverse side effects from using setting such as these(I am not aware of any when it comes to testing my program)?
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
NelsonMandella Wrote:Also the setting "relax ieee compliance gave me around a 15% increase as well, are there any adverse side effects from using setting such as these(I am not aware of any when it comes to testing my program)?

You mean side effects other than the numbers coming out being wrong? Of course, if all you do is add two numbers in your algorithm, it hardly matters. But if you could encounter singularities or rely on infinity/nan being what they're supposed to, there's trouble on the horizon.
Quote this message in a reply
Member
Posts: 194
Joined: 2009.02
Post: #3
What about division and multiplication?
Quote this message in a reply
Moderator
Posts: 373
Joined: 2006.08
Post: #4
I would go check out a list of gcc optimization flags.

Here's a couple of links to get you started:
http://tombarta.wordpress.com/2008/05/25/gcc-flags/
and
http://developer.apple.com/documentation...mmary.html

Hope that helps Smile
-wyrmmage

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
DoG Wrote:You mean side effects other than the numbers coming out being wrong? Of course, if all you do is add two numbers in your algorithm, it hardly matters. But if you could encounter singularities or rely on infinity/nan being what they're supposed to, there's trouble on the horizon.

Actually I compile Chipmunk using -ffast-math on PPC, x86 and the iPhone. Pretty sizable performance boost. Supposedly that disables specific checks for nan and infinity, but the code still runs fine and Chipmunk does rely on infinite values for some things. My guess is that the FPU used most modern CPUs simply does these checks internally.

People that have tried using that flag on a FPU-less CPU such as the DS or some other ARM processors have run into problems with -ffast-math though.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #6
Using LLVM instead of GCC on 03 is better for math intensive code. (At least for mine)
LLVM will eliminate redundant calculations better than GCC. (Judged by the outputted assembly)

Also, if your function is over a certain size, don't inline!
I did tests with this and sometimes, inline will slow code down.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  XCode doesn't realize a library has changed unless you force your project to build. XSTNX 6 5,996 Jun 8, 2009 10:25 AM
Last Post: XSTNX
  xcode build problem NelsonMandella 7 5,756 Apr 13, 2009 12:21 PM
Last Post: szymczyk
  Build SDL Games with OS X and XCode vmcodes 6 5,659 Jan 13, 2008 10:26 PM
Last Post: vmcodes
  Deployment build with XCode guvidu 1 3,233 Mar 22, 2007 09:20 AM
Last Post: Malarkey
  XCode Build Question DesertPenguin 6 6,045 Jan 7, 2007 01:07 PM
Last Post: OneSadCookie