Search Unity

Very poor performance on Android after upgrading to Unity 5

Discussion in 'Android' started by digitalMUTANT, Mar 3, 2015.

  1. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    So it is the Resources.load problem...is it a bug or is expected for Unity 5??
    What should I do to replace resources.load?? I use it to load all of my prefab ...any ideas?
     
  2. Derek-Wong

    Derek-Wong

    Joined:
    Jan 5, 2015
    Posts:
    16
    Another Update~

    As it is due to resources.load, I have tried to trace from the script and I found that I have 16 objects that called the same script, with 4 update checking if they need to call 4 resources.load.

    I have end up moved these resources.load to a parent script and load them by using public gameObject variable and drag prefab to the editor. And Dramatically those loading.loadFilesHeader have disappeared ~~ I have 30 FPS now~~ (still not 60 but well, it is much much better than 0.5FPS before).

    No matter what, it is obvious that Resources.load have costed much more than before (thought it force me to make my scripting better :D I am so happy now )

    Thanks for the help guys!
     
  3. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    @Derek Wong But you are still getting only ~30 fps instead of 60 fps that you are able to achieve on 4.6? That indicates that there is still some huge problem with android build, same as everyone else is still facing.
     
    Gekigengar likes this.
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    To me it seems that there is not only one huge, but several smaller issues. Some of them are related to changes in Unity 5, others about devices that have trouble to deal with the standard settings of Unity 5, and some are user mistakes that had less dramatic impacts in Unity 4.x.
    The main issue though is that many here start to talk about their issues, but almost no one actually nails them down.
     
    MrEsquire likes this.
  5. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Because I'd assume it's some general unity 5.0 backend issue no one of us can really do anything about.
    I mean, even empty scenes with nothing in it, not even a skybox or anything performs relatively bad on various devices.
    There's probably no way one of us users could really nail it down when it's a unity engine scripting issue unless we had the source to check there. But personally I don't wanna go there.
     
  6. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    FPSProblems.png
    Anyone had problems with this Device.Present? I am on Nexus 7 (2 gen)....
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Of course when you have an empty scene and the performance is not good on certain devices, you kind of nailed it down already, which means the only thing that needs to be done is to submit a bug report with the project, such that QA can reproduce it with the same settings. Of course it is necessary to mention the devices as well. I don't think many in this thread even got to that point.
     
    florianpenzkofer likes this.
  8. Deanit

    Deanit

    Joined:
    Nov 29, 2013
    Posts:
    6
    I had Device.Present issue because I used Mobile/Particles shaders on non-particle objects (this worked on Unity 4 without lag). Other issue may be global shadows turned on. I would suggest to check all shaders used in scene.
     
  9. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    Just tried only using the sprite diffuse shader. It helped a bit, but its still very CPU consuming.
     
  10. Reticulum

    Reticulum

    Joined:
    Feb 8, 2014
    Posts:
    10
    Patch 5.0.1p1 was released today.
     
  11. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Cool, saw it got a 'real 16 bit displaybuffer for android' now. Weird, my email notification for the patch release thread didn't notify me this time.
    Will give this version a try and report back.

    Notes say: "Added support for real 16bit DisplayBuffer. It can only be enabled in PlayerSettings" I assume by disableing the 32bit one and not actively enableing it somewhere.
    Alright, my testscene gives me 49-51 fps now with 32bit disabled, 44-47 when I leave it enabled, like before.
    It's better, but still strangely low. [using legacy and mobile shaders this time]

    Though I get an error trying to use the profiler now. Not sure if this is an issue on my end or a general one with this version.
    [CommandInvokationFailure: Unable to forward network traffic to device. (...)] restarting the adb server and phone didn't help.
     
    Last edited: Apr 16, 2015
  12. mellinsa

    mellinsa

    Joined:
    Apr 16, 2015
    Posts:
    7
    I got really bad performance with profiler on! And you might have read this already, but the issue one of the Unity guys stated about the JobScheduler mucking up on some devices could be the cause for your slowdown. Still weird that a dev build vs a non-dev one would be so different...
     
    Last edited: Apr 22, 2015
  13. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Watching thread, real issue here.
     
    milox777, jtsmith1287 and MrEsquire like this.
  14. CluelessMuffin

    CluelessMuffin

    Joined:
    Feb 14, 2015
    Posts:
    63
    My game even got slower on the official Unity 5.01
    even slower than Unity 5.0.0f4!!

    Should I return to 4.6 or what?
     
    Gekigengar and MrEsquire like this.
  15. CluelessMuffin

    CluelessMuffin

    Joined:
    Feb 14, 2015
    Posts:
    63
    is this solved on unity 5 p2?
     
  16. CluelessMuffin

    CluelessMuffin

    Joined:
    Feb 14, 2015
    Posts:
    63
    The problem with Unity 5.0.0f4 was the black bar bug - but I was having good performance on it. I dunno what to do now- I can't publish my game with such performance nor with a bar bug.
     
    Gekigengar likes this.
  17. XYnaut

    XYnaut

    Joined:
    Oct 10, 2014
    Posts:
    1
    @bitter Any known (official) known issues with Android performance? We're facing a significant drop of performance on Android too. Mostly related to the Canvas and Canvas Scaler. If we're disabling it, it runs much smoother (about +10 fps).
     
  18. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Sadly not..
     
  19. ThinkertonGames

    ThinkertonGames

    Joined:
    Feb 26, 2015
    Posts:
    20
    I'm experiencing what I think is a similar issue. It appears that my app has slowed down on what seems like Tegra based devices. It was running fine prior to 5.0 but has since plummeted on Nexus 7 and to a degree on Transformer Prime. Obviously they're newer devices but getting 100-200fps on Note 4, M8 and similar. Not sure if I can roll back at this point as I've been working in 5 for the last couple of weeks.
     
  20. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    That's literally 99% of every project lol.

    Who doesn't use physics, culling, and animation?
     
  21. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Empty scenes, that still perform horrible in 5.x, at least currently. :p
     
    MrEsquire likes this.
  22. ThinkertonGames

    ThinkertonGames

    Joined:
    Feb 26, 2015
    Posts:
    20
    I might also add that for some odd reason (I think someone else mentioned this), when debugging with profiler (development built active) it appears to run smoother on the Tegra devices.
     
  23. kalovito66

    kalovito66

    Joined:
    Oct 19, 2014
    Posts:
    2
    I have created an empty scene, added an FPS Script to the main camera and exported to android.
    In Unity5, FPS drops by ~30% , so i strongly believe this is not a physics, culling, and animation issue. I have tested the android apps on two devices, and also Bluestacks, FPS drops by roughly 30% in all cases. Using Unity 4.6f4 & Unity 5.0.1.
    I'll stick to Unity 4.6 free for now.
     
    Gekigengar and MrEsquire like this.
  24. TimSchroeder

    TimSchroeder

    Joined:
    Aug 27, 2014
    Posts:
    9
    We have performance problems on some android devices when the new UI system (Unity 5.0.1) is switched on. We get 60 FPS if we disable the 2 canvases in our scene. With canvases we get ~30 FPS.

    Edit:

    Working well on a Galaxy Tab Pro 10.1.

    Problems on Kindle Fire HD 8.9
     
    Last edited: Apr 29, 2015
  25. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I'm not sure where the UI team has disappeared to but its clear to me in the previous few patch releases UI has been struggling behind, even with the 4.6x versions there is many issues reported. I just wish for a official answer and some guarantee there be some future improvements in mobile performance.
     
  26. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Wasn't it mentioned several times already that they are working on the performance. It is a step by step process that takes time.
     
  27. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    But that's such a generic/vague thing to say - maybe a blog post of official(Unity members comment) answer would be best solution for all. I don't think you also understand some of these issues seriously effect games and in turn lead to wasted time from developers and negative comments from customers.
     
  28. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I don't see how a blog post changes the situation. They will make announcements only when they are sure they can make it for sure within that time. They could write a wall of text about different approaches they are taking to improve the performance, but that doesn't change anything.
    Of course, the current Unity UI performance is not good enough on mobiles. The Unity UI team is aware of that and they are working on it. The situation sucks, but more information about it won't help us and even worse, it would distract one of the coders who is working on the actual issue.
     
  29. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    It's not just the UI. The Mobile shaders seem to have a mind of their own. I have Line Renderer's drawing behind mobile diffuse shaders where they used to be in front.
     
    MrEsquire and Gekigengar like this.
  30. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    HAHAH, I get the same thing with the shaders! (Unity 5, Android Build).

    It somehow works fine on the editor though.
     
  31. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    This thread is like a pot containing everything and nothing. And no one actually cares to isolate the troublesome elements to report bugs, with the exception of the Unity UI. I still struggle to see the usefulness in complaining in a forum about bugs without reporting them.
     
  32. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    The problem is that even empty scenes with just an fps display of some sort (ui, legacy ui, text mesh, profiler) perform bad.
    So there seems to be a fundamental issue that is on Unity's side to figure out and fix.
    All we can say is that it started with Unity 5.
     
    MrEsquire likes this.
  33. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    How many did take the time to write bug reports about those fundamental issues? It is pretty valuable for Unity to know which devices are affected and how the performance is with Unity 4 compared to Unity 5.

    Just writing, having the same issue here, why doesn't Unity do something about it, is not helpful for anyone.
     
  34. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    I personally am not saying do something about it, we saying we wish for a status update on whats happening and if they know about the issue and working on a fix...no good you defending them if community all feels the same about the issue, we have the right to moan considering they keep pushing poor patch releases and already on 5.1 beta and no stability for mobile yet - so yeh and let them speak out for themselves..
     
  35. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    With a few exceptions, there aren't useful bug reports from people who are writing in this thread (or maybe everyone refused to write here that they reported the bugs). It is extremely naive in my opinion to expect that anything happens if there are no useful bug reports. I don't defend Unity, I say give them required information!

    Edit: Corrected the first sentence to express what I mean.
     
  36. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Please explain what you'd expect of a bug report for this situation?
    I mean all we can say is:
    -Unity version: 5.x
    -target platform: Android
    -devices: seemingly the majority that's out there, if not all but just not that noticable on high end devices.
    -scene: nothing in it, forward rendering, no fancy settings, no AA, low whatever you can set.
    -settings that cause low framerates: all?

    And you can't expect customers to buy the source code to be able to look for such core issues themselves.
     
  37. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is not really hard to do it. Create a simple scene in Unity 4, check the performance. Copy the project, open it in Unity 5, check the performance. Submit a bug report with all that information, including the actual device's information and an actual project, such that it can be easily reproduced.

    So far, I have only seen one bug report mentioned in this thread:
    http://forum.unity3d.com/threads/ve...grading-to-unity-5.306572/page-2#post-2018232

    What's the status of this bug? Unfortunately it is not in the issuetracker.
     
  38. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Still Open, nothing happened since.

    But submitting a scene becomes useless when all scenes lack performance (as said, even empty ones, without skybox) at like all possible editor settings in U5.
    The only thing left would be the devices, but since it affects a lot of devices, and I'm sure unity has quite a few devices at hand, that would become a secondary thing.

    I still wonder how such a performance drop went unnoticed when releasing unity 5.
     
  39. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Unity has automated performance regression testing. I don't know whether it doesn't work for mobiles or Android yet.

    Details are invaluable to resolve issues and so far you were the only person who reported a bug which is something I don't understand. And I couldn't find another one in the issuetracker, though I only did a quick search.
    http://issuetracker.unity3d.com/pro...ndroid&view=most_voted&unity_version=released
     
  40. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Or maybe its noticed but no time to fix until later. But I'm seriously shocked if Unity QA/Devs are surprised about this issue. Maybe poor beta testing took place for mobile during Unity 5 stages (Thank God for the 5.1 open to pro users and thread discussion) Like I said before to me all roads point to Unity GUI not being properly ported to Unity 5.
     
  41. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Maybe they don't put such 'vague' problems up on the issue tracker that haven't pin pointed the root of the issue, yet still are a serious problem.
    Not sure why my report isn't listed there and maybe others have reported it aswell and it just doesn't show up there.

    Have you reported it yet? ;)
     
  42. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    There is no reason why it shouldn't be in the issue tracker. If it is reproducible and definitely a performance regression, what should prevent them from having it there?
     
  43. Wulven1

    Wulven1

    Joined:
    Oct 7, 2014
    Posts:
    6
    Just to chime in, I also had a problem with Loading.LoadFileHeaders appearing when profiling on Nexus 7 after upgrading to Unity 5. I found out it was due to a few small textures from Resources.Load(). I had to make sure to never ever call Resources.Load(), or expect a huge fps drop that wasn't there in Unity 4.x. You can connect things in the Editor to a public variable, or cache the result of Resources.Load() at the start of the game instead... In fact, they should rename the function to Resources.LoadVerySlowlyOnAndroid(). :D
     
  44. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    SOOO WHERE IS OFFICIAL RESPONCE?!
     
    MrEsquire likes this.
  45. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Where is the case number?
     
  46. ZereZ

    ZereZ

    Joined:
    Jul 7, 2013
    Posts:
    2
    I'm having strange issues on android too. My profiler claims that PhysX is the problem (PhysX.Processing > PhysX.PxsCMDiscreteUpdateTask), but i have just 4 rigidbodies with a total of 12 contacts and none of the rigidbodies is moving (plus fully constrained). With Unity 4.6 everything worked just fine, but since Unity5 this scene (and really just this scene) is going down right at the start. On windows and within the editor the physics process takes 8ms, while on android it's nearly up to a second. The funniest thing is that I don't know which objects are causing these calculations because they are named N/A in the object list. Is this normal? Another thing i noticed was that, in timeline perspective, the PhysiX.Processing task is run once per interval (update?) on windows/editor. On my Galaxy Note 10.1 the PhysX.Processing task shows up several (17) times in one interval with a runtime of 50ms each. Could this be because of my framerate being <1fps, so that fixedUpdated has enough time to start physX-processing several times?
    Anyone any thoughts to this?

    Profiler1.png Profiler2.png
     
  47. milox777

    milox777

    Joined:
    Sep 23, 2012
    Posts:
    195
  48. ZereZ

    ZereZ

    Joined:
    Jul 7, 2013
    Posts:
    2
    Found the problem... PhysX was constantly trying to push the rigidbodies out of the other collider while their positions were constrained -.- Doh..
     
  49. Droidspirit

    Droidspirit

    Joined:
    Aug 16, 2014
    Posts:
    43
    Same problem here. On Unity 4.6.x my game works fine. After upgrading to 5.0.1p3 the game laggs.
     
  50. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I love this threads, there are at least 5 different issues that are being experienced. Some have issues with empty projects, others with graphics, others with physics and some just complain for the sake of it. Is this thread supposed to change anything by trying to isolate the issues and give Unity the required information to resolve the issues, or is it just about complaining?