Game jittery on first run

right, when testing my game on the iphone 1 in xCode, it would naturally be more sluggish than when it’s run without xCode, however this is what I noticed:

Whyyy???

probably because of debug logging or some such. Why is water wet? Why even use the first iphone.

right, but it’s not a development build. I use the first iphone to make sure my game will work on first iphones as that is required.

no one knows?

You haven’t supplied any meaningful data for us to help with, I’d love to help, I just don’t know what you are unhappy with. Generally things will always be slower when run from xcode as opposed to standalone, due to console printing, debug logging and the extra data that entails - this is especially true of the slowest iphone.

I don’t think you have a problem.

right, but the problem is that I have to launch the game several times (first from xcode, then several times more from the iphone) before it becomes smooth. will this problem persist when the app is published?

is xcode still running your game when you load it from the iphone?

or do you click “stop” on xcode first?

I rechecked- the steps I followed were:

1.click stop in xCode
2.unplug the phone
3.first 3 runs were still slow, then twaz fine

it definitely sounds like a RAM issue, you should copy-paste the iphone profiling data

http://unity3d.com/support/documentation/Manual/iphone-InternalProfiler.html

okey there you go - hope this tells you something:

your mono memory is growing consistently…

405504
438272
479232
512000

are you constantly allocating or initializing new variables? or using multidimensional arrays? this means the garbage collector will be triggered much more than necessary, and the GC causes a lot of lag.

your update() functions are taking upwards >20ms … that is a lot. can you optimize, or spread the calculations across multiple frames using coroutines?

you have a really high max on your cpu-player… i bet you have a big loop going through and eating up a lot of processing that doesnt have to be done every frame.

…it’s the iphone1. Having 20ms on your main loop isn’t that hard to achieve. The growing ram problem is an issue though.

I get a similar problem. When my game first renders objects it stalls. I attributed it to submitting geo to the GPU and or possibly compiling a shader or something. I’m yet to figure out how to do this on launch to stop the stutter while running.

I have this problem too, in a simple scene with a couple of static lights the game will stall frames the first time the character gets touched by each light, then after that the game will run smoothly.