In This Thread, We Provide Insight into iPhone Internal Profiler Stats

Hello,

I’ve noticed that a lot of people are looking for insight into their profiler readings. So I’ve decided why not make an official thread to post readings, and have the Unity masterminds provide reasons as to such to make optimizations easier for all of the clueless (like me). I hope to have great findings that might affect lots of iOS devs.

I’ll start off by posting my readings from the internal profiler:

iPhone Unity internal profiler stats:
cpu-player>    min: 19.9   max: 57.0   avg: 24.4
cpu-ogles-drv> min:  2.2   max: 13.4   avg:  3.1
frametime>     min: 28.8   max: 64.8   avg: 35.5
draw-call #>   min:  15    max:  16    avg:  15     | batched:    71
tris #>        min:  5502  max:  5664  avg:  5604   | batched:   176
verts #>       min:  3695  max:  3794  avg:  3757   | batched:   352
player-detail> physx:  0.9 animation:  1.3 culling  0.0 skinning:  0.8 batching:  0.2 render:  4.0 fixed-update-count: 1 .. 4
mono-scripts>  update:  4.4   fixedUpdate:  0.7 coroutines: 10.4 
mono-memory>   used heap: 1568768 allocated heap: 2084864  max number of collections: 0 collection total duration:  0.0
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player>    min: 19.9   max: 64.5   avg: 24.1
cpu-ogles-drv> min:  2.3   max:  6.6   avg:  2.7
frametime>     min: 26.8   max: 72.4   avg: 35.0
draw-call #>   min:  16    max:  16    avg:  16     | batched:    70
tris #>        min:  5660  max:  5662  avg:  5660   | batched:   174
verts #>       min:  3786  max:  3790  avg:  3787   | batched:   349
player-detail> physx:  1.0 animation:  1.2 culling  0.0 skinning:  1.0 batching:  0.2 render:  4.8 fixed-update-count: 1 .. 3
mono-scripts>  update:  3.7   fixedUpdate:  0.6 coroutines: 10.0 
mono-memory>   used heap: 1658880 allocated heap: 2084864  max number of collections: 0 collection total duration:  0.0
----------------------------------------

What would be causing my bottlenecks?

Thanks.

You are heavily CPU bound, cpu-player values are very high, so are update and coroutines.

Look at your Update() and coroutines and optimize there. :slight_smile:

Hmm, thanks! I’ll look and see what needs to be fixed…keep em coming everyone!!

Help!!

----------------------------------------
iPhone Unity internal profiler stats:
cpu-player>    min: 13.0   max: 67.8   avg: 17.4
cpu-ogles-drv> min:  1.0   max:  2.6   avg:  1.3
frametime>     min: 25.0   max: 77.2   avg: 34.5
draw-call #>   min:   6    max:   6    avg:   6     | batched:    20
tris #>        min:  2080  max:  2080  avg:  2080   | batched:    88
verts #>       min:  1848  max:  1848  avg:  1848   | batched:   176
player-detail> physx:  0.7 animation:  0.5 culling  0.0 skinning:  0.4 batching:  0.4 render:  1.8 fixed-update-count: 1 .. 4
mono-scripts>  update:  3.1   fixedUpdate:  0.2 coroutines:  8.9 
mono-memory>   used heap: 1245184 allocated heap: 2084864  max number of collections: 0 collection total duration:  0.0
----------------------------------------

I can’t seem to figure out what exactly is making the frame times and CPU player spike like this. Everything else seems well within range. Could it be Unity 3.5 beta? I only started seeing this after the update.

Mono-scripts → coroutines 8.9 is very large. You are doing too much processing per frame in coroutines. If it’s just bulk, multi frame work you could look into threading. But it’s hard without seeing examples of coroutines you use a display of the built-in Profiler that runs in editor. (As that would give you function names).

Thinking about it a bit more 8.9 isn’t actually horrible (~half your frame is spent in coroutines if you were at 60 fps). Do you happen to have Pro? The iOS internal profiler is good for figuring out which major component is bottlenecked (CPU, GPU, Physics, GCs, etc…), but not so good at finding the more low level issue. It’s definitely CPU side rather than graphics, and physics looks fine, but outside of ‘your scripts’ it’s harder to pin point it down knowing so little about the game and code as a whole.

Could you shed some light on threading? And I would use the profiler but I only have Unity iOS basic.