list of features that are BAD for iOS (iphone)

Hey there Unity Answers... Is there a list anywhere (or do any of you have tips) of features to stay away from when creating games for the iPhone4? I've heard fog, excessive instantiation.... are there other things that people have noticed have been a problem.

Currently, my game runs at 200FPS on my mac, but slows down on my iPhone. I know it is far less powerful, which is why I'm casting a wide net to see what things i might have in my app that are drastically killing the FPS once on the device.

Thanks in advance!

(also side note: anyone know of a bit of code to use that would run on the device to show it's FPS as it's running)

This is really not a complete list, but off the top of my head:

The most important things to consider are your drawcalls. For example, an iPhone 3G really starts doing funky things over 25-30 drawcalls.

You could reduce your physics Solver Iteration count (from Edit> Project Settings > Physics) and use interpolation.

Try avoding instantiating / destroying objects. In some cases, implementing a GameObject pool might improve performance drastically.

Try to stay away from comparing strings and never use GameObject.Find .

Try to use Switch statements instead of many if / if else nested statements.

I also try to use extremely simple shaders. I usually blend all my external lightmaps and any other maps into the diffuse one and use a Texture Only mini-shader.

You should also try to stay away from using alpha-testing shaders if you're planning to release for the ipad. Due to it's high resolution and really boring hardware if has quite a few fill-rate related problems.

Another big one that has not been mentioned is to avoid using GUI objects. Each GUI Object adds to your draw calls, but if you use 3D objects, SpriteManager, or EZGUI and SM2 instead (EZGUI and SM2 cost money), you can reduce your GUI draw calls significantly.

This Answer has some good info on reducing draw calls in a 3D Environment: http://answers.unity3d.com/questions/30419/reducing-draw-calls-vs-culling

Very in-depth answer on reducing Draw Calls: http://answers.unity3d.com/questions/7247/whats-the-best-way-to-reduce-draw-calls

Also for testing on iPhone and iPad, I think this is a great answer everyone should read: http://answers.unity3d.com/questions/9269/confusing-ipad-performance-problems-help

  1. Use vertex lit shaders instead of vertex colored on anything that doesn't fade
  2. Avoid large amounts of blended pixels: 2 particles close to cam is worst than 25 particles far away.
  3. Make motion framerate indipendent:

    position += velocity * time;

  4. Avoid anything thats non diffuse when possible
  5. Skybox shader is your friend
  6. Avoid clear on camera if the background hits every pixel
  7. (Design) Many smaller scenes > 1 long loading scene
  8. Use UnloadUnusedAssets()
  9. Use very few cameras / lights
  10. Batch draw sprites
  11. Triangle limit is ~ 15k
  12. Be smart with LOD's if you can afford the ram.

The best way to assess FPS and see what subsystem is "eating" most of your frame time is to enable built-in iOS profiler : http://unity3d.com/support/documentation/Manual/iphone-InternalProfiler.html

If you want precise answers you should read through the docs:
http://unity3d.com/support/documentation/Manual/iphone-GettingStarted.html
http://unity3d.com/support/documentation/Manual/iphone-performance.html
http://unity3d.com/support/documentation/Manual/Reducing%20File%20size.html
http://unity3d.com/support/documentation/Manual/Optimizing%20Graphics%20Performance.html
http://unity3d.com/support/documentation/Manual/TroubleShooting.html#iPhoneTroubleShooting
http://unity3d.com/support/documentation/Manual/Debugging.html

BTW it’s absolutely possible to use GameObject.Find, but you should avoid it in Update functions. In Awake it’s no problem at all.
The built-in profiler is for Pro only.