Search Unity

Unity 5.2 iOS performance issues

Discussion in 'iOS and tvOS' started by Blundig, Sep 9, 2015.

  1. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
    The optimisation that landed in 5.3 is dependent on a framework that doesn't exist in 5.2.
    However, we are looking at providing an intermediate fix for 5.2.
     
  2. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    FYI,

    I've updated to 5.3 beta 5 and for me I still have the issue of an incredibly slow app on iPad3

    So, either the bug fix is not int 5.3 beta 5 or my issue is something else.

    I'll try to get time to test with a pre-5.2 build.

    -Jeff
     
  3. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
    The optimisations will be coming in 5.3 beta 6.
     
  4. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,119
    Has anyone tried replacing the sprite shader as was previously suggested?
     
  5. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    I see 5.6 is out. Did the fix make it in? I looked at the release notes and nothing jumped out at me as being the fix.

    Thanks,

    -Jeff
     
  6. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
    The optimisation is in beta 6. Please test it and let us know if it fixes your problem.
     
  7. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Well, I tested and unfortunately I I still only get 20 fps or less on iPad3. Possibly this is just an issue with my app and not related to 5.2. I have not tested on a pre 5.2 version of Unity yet. It just seems odd that it's SO much slower on iPad3 than iPad2 and iPodTouch 5th gen.

    Guess I'll need to find the time to install Unity 5.1 and test.

    -Jeff
     
  8. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    iPad 3 has four times the resolution to render. Maybe thats the problem?
     
  9. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
  10. Blundig

    Blundig

    Joined:
    Jan 7, 2014
    Posts:
    18
    Just noticed there has been lots of action on this thread. I checked against the project I submitted for bug https://fogbugz.unity3d.com/default.asp?728361_pr79ufas4vfal1dj. Here are the results:

    1. Unity 5.2 - the shader workaround posted by aleksandras fixed the spikes.
    2. Unity 5.3.0f1 - fixed the spikes, no need to change from the default shader.
    3. Unity 5.3.0f1 fixes the choppy playback issues I was having in a complete game project, not just the bug report demo project.

    I haven't tested my real world apps thoroughly, but the results are promising! Also, there has been some mention of Graphics APIs and Vertex Compression in this thread. For my specific test cases, none of these settings had any impact. Results were the same with OpenGLES2, Metal, and Vertex Compression.

    On a side note...
    Unity is now ignoring the Application.targetFrameRate setting. It will render as many frames as possible, no matter what (according to the profiler). This wasn't the case in Unity 5.1. If you set Application.targetFrameRate = 30, the engine would lock to a maximum of 30 fps. With the fix, it always acts like it is set to -1. I encourage the Unity team to look into this as a separate issue.
     
  11. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Last edited: Dec 1, 2015
  12. MoiDixMois

    MoiDixMois

    Joined:
    Jun 9, 2012
    Posts:
    20
    got the same exact problem on unity 5.2.2, my game much chopppier now on iOS 4, anyone tried unity 5.2.3 already if theres any change/fix?
     
  13. Taishou

    Taishou

    Joined:
    Jun 24, 2014
    Posts:
    21
    I tested 5.2.3 but still face the same problem on my iPad 3. On this device in a scene with about 7k tris the profiler outputs an overhead of 75% on average and I got only 15 frames. On my iPhone 5 and 6S everything is fine. The performance on iPad was becoming worse and worse over the last releases.
     
    Last edited: Dec 2, 2015
  14. Tendro

    Tendro

    Joined:
    Jul 16, 2014
    Posts:
    3
    I don't know if it is the same problem but my game is set to "Application.targetFramerate = 60" and running at around 30fps (iPod touch 5th gen, iPad 2, iPad Air 2, ...). The profiler is connected to the device and showing 65%+ overhead and those weird "spikes"... It's just a simple scene with the logo moving in front of the gameplay area.

     
  15. BrianND

    BrianND

    Joined:
    May 14, 2015
    Posts:
    82
    I noticed in the sprite shader there is a conditional.

    if (_AlphaSplitEnabled)
    color.a = tex2D (_AlphaTex, uv).r;

    I removed it and gained a bunch of speed. Could the branching in the shader cause the performance issues?
     
  16. engnyksl

    engnyksl

    Joined:
    Jul 30, 2014
    Posts:
    2
    Was using 5.2.3 and had stutters and lags in a simple 2D game. Tried again in 5.2.1 still the same issues. I can't revert to 5.1.4 because of some plugins I guess so I couldn't try that unfortunately. Performance issue still continues.
     
  17. pixity71

    pixity71

    Joined:
    Apr 23, 2015
    Posts:
    7
    Still having terrible performance issues (low FPS) on older 32 bit iOS devices for latest 5.3 beta. Stuck with 5.0.
     
  18. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    @Unity is this still an active issue for you guys? Seems to still be something wrong.

    -Jeff
     
  19. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Can you further comment on this and see the comments above..
     
  20. sandboxed

    sandboxed

    Unity Technologies

    Joined:
    Apr 6, 2015
    Posts:
    95
  21. Tendro

    Tendro

    Joined:
    Jul 16, 2014
    Posts:
    3
    Got my 2D game to smooth 60FPS on my iPod 5th gen yesterday with Unity 5.2 (tweaked audio and collision stuff)... now with Unity 5.3 and not changing anything it's at 50FPS in the main screen and at 30FPS+ during gameplay.



    In the main screen those spikes are Overhead and somehow Physics.FixedUpdate takes up 25% now during gameplay. Objects using Rigidbody2D have isKinematic set to true. Going to downgrade to 5.2 and check the differences in the profiler. :(

    edit: I just went back to 5.2 and I'm having 60FPS again.
     
    Last edited: Dec 8, 2015
    MrEsquire likes this.
  22. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Pretty sad to say that the problem still exists in 5.3.0f4. Hick-ups in smooth 2D movement and music playback with minimalist setup.

    Testfile is attached to this post: http://forum.unity3d.com/threads/unity-5-lag-stutter-movement-audio.368442/

    As mentioned earlier, if it is not me, this could be an IPAD 3 issue.

    Can someone confirm to have build a playable IPAD 3 app with Unity 5?
     
    Last edited: Dec 8, 2015
    engnyksl and MrEsquire like this.
  23. engnyksl

    engnyksl

    Joined:
    Jul 30, 2014
    Posts:
    2
    Tried with 5.3.0f4 today, iOS 9.2, xCode 7.2. Nothing has changed unfortunately. Game is so smooth on other OS but not on iOS. Trying with iPhone 5S btw.
     
  24. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    Metal has been broken since the introduction in Unity. You still have to force to OpenGL 2 unfortunately.
    The performance jumps between 20-60 fps and freezes. We get 2 second freezes when GUI elements are sliding to the screen. The whole game just freezes in random frame during the slide for 2 seconds on iOS. Switching to OpenGL 2 always smooth and smooth 60fps.
    Now with Unity 5.3 the Android builds are also having problems with UI rendering. The UI will show broken frames about every 1 second. So now the OpenGL2 is also broken. Unity 5 has been a disaster.

    When you publish something in AppStore Apple might ask you about what new technologies are you using, like Metal. Well we can't say we use Metal because its broken in Unity. We are using the old OpenGL2.
    This is probably not very good for you company to get promoted by Apple because you are not using any new technology.
    Unity is doing nothing to fix these problems the only cure seems to be that everybody asks Apple to ban Unity from the store until they fix this. We don't need new features we need these bugs to be fixed.
     
    MrEsquire likes this.
  25. alesm-o7

    alesm-o7

    Joined:
    Sep 30, 2015
    Posts:
    3
    We've just released a new app and a few updates for older apps using Unity 5.1.4, even though we were aiming to use 5.2 or even 5.3.
    The overall performance with Unity 5.2/5.3 is just too weak on all mobile platforms. Some of my tests show around 30% (and even more with 5.3) decrease in performance on a good mobile android device.
    Hopefully this will get fixed because we really need a couple of the windows phone fixes from the new releases.
     
    MrEsquire likes this.
  26. johnpine

    johnpine

    Joined:
    Sep 19, 2015
    Posts:
    26
    this problem has zero to do with any sprite shaders. this problem is with PRE unity ui games done in Unity 4 also.
    trying metal on the game drops the frame rate jumping between 20-50 when on opengl it runs 60fps.
    ( a little credit that on 5.1 the game is slightly even faster on opengl 2 than it was on latest utnity 4 builds )
     
  27. Taishou

    Taishou

    Joined:
    Jun 24, 2014
    Posts:
    21
    For all those who have performance issues on iPad 3, after I replaced all materials which have Unity's Standard shader applied with mobile diffuse the performance in my game improved dramatically. I guess this has to do with the environment settings when it comes to reflections. Unity should consider a standard shader that performs well on every device.
     
    MrEsquire likes this.
  28. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    We can only wish..
     
  29. pixity71

    pixity71

    Joined:
    Apr 23, 2015
    Posts:
    7
    Anyone have luck with 5.4.0B1 with regards to performance / low FPS issues on 32 bit iOS devices
     
  30. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I rather people check 5.3.1patch1 then a beta version.
     
  31. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    57
    I have the same issues with an iPad Air. All the stuff going on is way below 33ms/frame, but with the overhead it adds up to over 33ms so the framerate drops. I'm using 5.3.2p2
     
  32. Nith666

    Nith666

    Joined:
    Aug 1, 2012
    Posts:
    57
    Ok, so for me I've finally figured it out. The problem were image processing scripts I had on my camera. Apparently, these effects don't appear in the profiler, but they brought my framerate down to sth. like 10-20fps. I used fast bloom and color correction, once I removed the scripts everything ran smoothly at 30FPS. Does anyone know if there are really fast alternative effects available for mobile use?
     
  33. yonek

    yonek

    Joined:
    Jun 7, 2009
    Posts:
    64
    I did some tests on this issue today. 5.3.2p4 and it is still broken. An fresh project and scene with one quad (Mobile/Diffuse) filling the screen takes 6ms to render on iPad Air 1 no Metal. When switched to gles3 it runs under 3ms.
    And I'm not talking the execution time of complete frame on the profiles but the time deep inside the fragment shader viewed in Instruments.

    In my other project I've switched from Metal to gles3 few weeks ago because the rendering went nuts. It was OK but few 5.3 patches ago the Metal went crazy showing weird interpretations of Standard Shader on the device.
     
    MrEsquire likes this.
  34. holliebuckets

    holliebuckets

    Moderator

    Joined:
    Oct 23, 2014
    Posts:
    496
    Have you been able to try the new 5.3.3 build yet? I'm very interested to see if your performance tests are the same as mine lol
     
  35. maniacanshul

    maniacanshul

    Joined:
    May 4, 2016
    Posts:
    3
    Is this thread still active?
    I am having the same problem.
    I am currently using Unity 5.3.4. I also tested the build with the latest beta release Unity 5.4.0B6 but the same problem is happening.

    Devices Tested on: iPhone4s, iPhone5, iPhone6, iPhone6s, iPad2, iPadMini
    Devices working fine: iPhone4s, iPhone5, iPhone6s, iPad2
    Devices giving low performance: iPhone6, iPadMini

    The CPU overhead is increasing from an average of 0.4ms(on iPhone4s, iPhone5, iPhone6s, iPad2 )to upto 60ms(on iPhone6, iPadMini). I profiled this using Unity's active profiler. I get FPS as low as 12 on iPadMini. On iPhone5 and other working devices although the FPSCounter is always stuck at 30fps but the performance is much better.
     
    sngdan and MrEsquire like this.
  36. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    BUMP THREAD
     
  37. ottolb

    ottolb

    Joined:
    Jul 1, 2009
    Posts:
    42
    amoraleite and MrEsquire like this.
  38. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Hi, is there an update on this issue? What's the best version of Unity to use to avoid it? I'm currently using 4.7 and am experiencing the same random periods of slowdown on an iPhone 6S+. If I have to upgrade the project to 5 (which I don't particularly want to do!) I'd like to try and target the right version of 5... It sounds like 5.1.4 might be the one to go for?
     
  39. Bitvork

    Bitvork

    Joined:
    Aug 31, 2015
    Posts:
    4
    I am experiencing brutal random overhead spikes with iPhone 6 Plus. :-/ Profiler says nothing (empty gap)...
     
    MrEsquire likes this.