While optimizing our project I frequently ran into problems with low framerates on the iphone4, both on iOS 4.3 and iOS5. However when I built the same project to an Ipad 1 I saw a huge performance increase. On the iphone4 devices I frequently got as low as 22-23 fps when a lot of stuff is happening on the screen. On the ipad1 I had problems getting it to drop to 35, usually staying 38+.
I’ve copied a series of results from the internal profiler on both an Iphone4 iOS5 (also tried Iphone 4 with iOS4.3, but the results were pretty much identical) and on an Ipad1 with iOS4.2.
The “simple scene” is the start of the level in my project, should be identical on both devices. A skinned character idling in an environment with a shadowblob and a charactercontroller, a lightmapped scene with few elements. The viewport is top-down so viewdistance is not really factoring into differences between the two scenes.
In the “heavy scene” I´ve run along and pulled some enemies to me. It has an additive transparent lightbeam taking up a lot of screenspace. Three additional characters with pathfinding, some more scene objects on screen, and I’m trying to collide and mess around with them as much as possible. These scenes are not identical. But over time the Ipad1 kept to around 37-38fps, while the iphone4 ranged from 22-28fps in the heavy part.
Wondering if someone knows any reason I should be seeing this huge a difference. Afaik the ipad1 and iphone4 has the same CPU, but the ipad1 has less memory and more screen real-estate to draw. So I’m surprised at the results. On an Ipad2 it runs at a steady 60fps all over(yey!) And I’m going to test on an Ipad1 with iOS5 over the weekend.
Here are the results, hoping someone spots something crucial so I get consistent performance on both devices.
It’s the exact same project built to both devices, just swapped cables and rebuilt.
Built with XCode 4.2
IPAD1 iOS 4.2.1 build target iOS 4.2
Simple part of level 60fps
iPhone Unity internal profiler stats:
cpu-player> min: 12.5 max: 15.9 avg: 13.9
cpu-ogles-drv> min: 0.7 max: 2.4 avg: 0.8
cpu-waits-gpu> min: 1.3 max: 10.6 avg: 5.7
msaa-resolve> min: 0.0 max: 0.0 avg: 0.0
frametime> min: 15.0 max: 18.8 avg: 16.7
draw-call #> min: 12 max: 13 avg: 12 | batched: 35
tris #> min: 2399 max: 2407 avg: 2402 | batched: 2970
verts #> min: 2220 max: 2236 avg: 2227 | batched: 1387
player-detail> physx: 2.7 animation: 0.2 culling 0.0 skinning: 0.3 batching: 0.1 render: 2.3 fixed-update-count: 0 .. 1
mono-scripts> update: 1.3 fixedUpdate: 0.2 coroutines: 0.0
mono-memory> used heap: 1245184 allocated heap: 1617920 max number of collections: 0 collection total duration: 0.0
Heavy part of level ca. 38fps
iPhone Unity internal profiler stats:
cpu-player> min: 19.1 max: 24.0 avg: 21.2
cpu-ogles-drv> min: 1.3 max: 3.9 avg: 1.5
frametime> min: 24.1 max: 30.9 avg: 26.3
draw-call #> min: 27 max: 29 avg: 27 | batched: 61
tris #> min: 5866 max: 6174 avg: 6104 | batched: 4489
verts #> min: 5076 max: 5403 avg: 5320 | batched: 2282
player-detail> physx: 4.9 animation: 0.6 culling 0.0 skinning: 0.9 batching: 0.1 render: 8.1 fixed-update-count: 0 .. 1
mono-scripts> update: 3.7 fixedUpdate: 1.1 coroutines: 0.1
mono-memory> used heap: 1626112 allocated heap: 2158592 max number of collections: 0 collection total duration: 0.0
Iphone4 iOS 4.3.5 build target iOS 4.3
simple part of level ca. 48fps
iPhone Unity internal profiler stats:
cpu-player> min: 9.7 max: 21.7 avg: 15.8
cpu-ogles-drv> min: 1.0 max: 3.1 avg: 1.5
frametime> min: 13.4 max: 27.0 avg: 20.6
draw-call #> min: 13 max: 14 avg: 13 | batched: 38
tris #> min: 2435 max: 2443 avg: 2439 | batched: 3024
verts #> min: 2271 max: 2287 avg: 2279 | batched: 1414
player-detail> physx: 5.1 animation: 0.2 culling 0.0 skinning: 0.4 batching: 0.2 render: 4.1 fixed-update-count: 0 .. 1
mono-scripts> update: 2.3 fixedUpdate: 0.3 coroutines: 0.0
mono-memory> used heap: 1798144 allocated heap: 2154496 max number of collections: 0 collection total duration: 0.0
heavy part of level ca. 25fps
iPhone Unity internal profiler stats:
cpu-player> min: 24.7 max: 33.4 avg: 28.1
cpu-ogles-drv> min: 1.8 max: 4.3 avg: 2.5
frametime> min: 31.6 max: 44.0 avg: 37.0
draw-call #> min: 24 max: 28 avg: 26 | batched: 69
tris #> min: 6156 max: 6770 avg: 6375 | batched: 5140
verts #> min: 5347 max: 6017 avg: 5609 | batched: 2608
player-detail> physx: 9.7 animation: 0.9 culling 0.0 skinning: 1.1 batching: 0.1 render: 5.0 fixed-update-count: 1 .. 2
mono-scripts> update: 5.6 fixedUpdate: 1.9 coroutines: 0.1
mono-memory> used heap: 1859584 allocated heap: 2154496 max number of collections: 0 collection total duration: 0.0