Hi everyone,
I noticed every 10 seconds or so the frame rate of my game slows dramatically. I’ve used the Xcode console although I’m still unsure as to what the problem is.
Here is the output of the Console in Xcode for one of the times where it slowed down a lot. The physx is quite high although during the time that this reading occured I don’t believe there would have been any more calculations for the Physx as I was doing exactly the same thing as normal in the game. (No special buttons were pressed, or abnormal animations on screen etc…)
iPhone Unity internal profiler stats:
cpu-player> min: 47.2 max: 513.7 avg: 105.8
cpu-ogles-drv> min: 1.9 max: 8.3 avg: 2.5
cpu-waits-gpu> min: 0.2 max: 0.8 avg: 0.2
msaa-resolve> min: 0.0 max: 0.0 avg: 0.0
cpu-present> min: 0.8 max: 11.6 avg: 1.5
frametime> min: 57.7 max: 526.9 avg: 113.5
draw-call #> min: 42 max: 46 avg: 43 | batched: 1
tris #> min: 10067 max: 12326 avg: 11095 | batched: 126
verts #> min: 5065 max: 6219 avg: 5605 | batched: 86
player-detail> physx: 62.9 animation: 14.9 culling 0.0 skinning: 1.3 batching: 0.0 render: 6.5 fixed-update-count: 3 … 25
mono-scripts> update: 13.8 fixedUpdate: 2.2 coroutines: 0.1
mono-memory> used heap: 610304 allocated heap: 2387968 max number of collections: 0 collection total duration: 0.0
This can be compared to the normal reading (and frame rate) I get the majority of the time which gives the following as output from Xcode.
iPhone Unity internal profiler stats:
cpu-player> min: 47.8 max: 73.7 avg: 57.2
cpu-ogles-drv> min: 1.9 max: 9.2 avg: 2.6
cpu-waits-gpu> min: 0.2 max: 0.3 avg: 0.2
msaa-resolve> min: 0.0 max: 0.0 avg: 0.0
cpu-present> min: 0.9 max: 6.7 avg: 1.3
frametime> min: 54.9 max: 87.0 avg: 65.0
draw-call #> min: 41 max: 44 avg: 42 | batched: 0
tris #> min: 7899 max: 10847 avg: 9340 | batched: 0
verts #> min: 4009 max: 5433 avg: 4711 | batched: 0
player-detail> physx: 33.2 animation: 5.3 culling 0.0 skinning: 1.2 batching: 0.0 render: 5.9 fixed-update-count: 3 … 4
mono-scripts> update: 8.8 fixedUpdate: 1.1 coroutines: 0.0
mono-memory> used heap: 716800 allocated heap: 2387968 max number of collections: 0 collection total duration: 0.0
You can see that of the two readings, the one that really slows on the device as a greater ‘cpu-player’ max, higher FixedUpdate count as well as Physx and animation values.
Perhaps it’s something to do with the CPU? If so, would that only be possibly affected by the scripts running and therefore I need to look there?
Thanks in advance for any light you can shed on this!
Similar Unity Answers post (slightly different wording but same problem);