Search Unity

[Android] Very slow loading of some prefabs in 2017.1

Discussion in 'Editor & General Support' started by Spixy, Sep 4, 2017.

  1. Spixy

    Spixy

    Joined:
    Sep 17, 2014
    Posts:
    5
    Hi,
    In my game I have about 10 NPC prefabs, each prefab would load in 50-200 ms on Android in Unity 5.6.1.
    After I upgraded to 2017.1, each load takes 3-4 seconds, and all NPC objects are loaded in 45 seconds. (!!!)
    I tried Resources.LoadAsync and referencing prefabs in ScriptableObject, but none of them helped.
    If I removed all references of animations from prefab (Avatar, Clips), loading time went down to 9 seconds.



    Each NPC has 3 MonoBehaviours, Animator, BoxCollider, RigidBody, SkinnedMeshRenderer and few bones.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    It seems you found a regression in 2017.1, thus I recommend to submit a bug-report following the advice in this document, to help that this issue does not occur in future Unity releases.

    Using the bug-reporter seems to be an important step, because it makes sure the report is in Unity Technologies bug-tracking pipeline and has to be processed at some point. Using the forum is often used to add to a little more attention to a bug-report, but does not replace actually submitting a bug-report.

    It's from advantage to attach a project to the bug-report that UT can use to reproduce the issue and test their fix against. The easier an issue can be reproduced by QA, the more likely it is to get forwarded to a developer, who might or might not work on a bug-fix for that at some point.

    After you submitted the bug-report, you receive a confirmation email with a Case number. UT often asks us to post the Case number in the forum thread, which allows them to find that bug-report if they look at your post.

    Following these steps will increase the chance that UT is looking at your issue tremendously.
     
  3. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    Do you find a solution to this issue ? We can't release right now on Android because of this.
     
    Last edited: Sep 22, 2017
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    If nobody is going to submit a bug-report, but tries to workaround the issue, we'll most likely never see it fixed in future Unity release.
     
  5. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    We already submitted a bug report with an example project where the issues can be reproduced.

    Our bug id is: 949035 but it hasn't been added to the Issued Tracker list yet :(
     
    Peter77 likes this.
  6. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    We are going to try Unity 2017.2 because currently is release candidate.

    https://unity3d.com/es/unity/beta/unity2017.2.0b2

    Android: Significantly improved the performance of large prefabs loading (Resources.Load*or AssetBundle.LoadAsset* APIs) on Android.
     
  7. elhispano

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    This bug has been fixed in 2017.2 ;)
     
    Spixy likes this.
  8. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    Anyone from Unity team here?
    When will the fix backported to 2017.1?

    I tried 2017.1.2f1 and 2017.1.2p2, but the issue persists.
     
    LampRabbit likes this.
  9. LampRabbit

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    30
    I have also tried all possible versions and have the same issue.

    I guess we just wait for 2017.3 and hope that is it actually fixed :S
     
  10. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
    Hey!
    We're still having this problem on Unity 2017.2 (we've been checking the latest patches too). @elhispano are you using il2cpp or mono? (we're on mono)
    Any one else?

    Submitted a repro project (case 969845) on Unity 2017.2.0p2
     
  11. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
    Ps. just found that on 2017.1.2p3 it seems to be fixed, at least in our case (though not stated in the release notes)
     
  12. LampRabbit

    LampRabbit

    Joined:
    Jan 31, 2013
    Posts:
    30
    @drolak - I gave 2017.1.2p3 a go but no change to the loading times for me at least :(
     
  13. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
    @LampRabbit Please file a bug report then.. looks like we have the same symptoms but different issues. We noticed a huuuge performance hit on Resoruces.LoadAsync - when loading character models (without animations even - as those are shared) and absymal load times for app. We still see it in 2017.2.0p2 but not in 2017.1.2p3 (though app load times are still quite slow).
     
  14. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
    I case this helps anyone: we detected that the loading times were absymal for one particular FBX. Instead of loading it via Resources we decided to keep a direct reference to it (so it's now loaded with the scene). This fixed the issue.
     
  15. flashmandv

    flashmandv

    Joined:
    Mar 26, 2015
    Posts:
    156
    I still have the problem in 2017.1.2p4
    Any ideas? I cannot go to 2017.2 as it breaks my entire project (shadows, shaders, etc..) :(((
     
  16. hutch_jl

    hutch_jl

    Joined:
    Jan 8, 2013
    Posts:
    40
    We've found that building programmatically via BuildPipeline in 2017.1 avoids this issue for anyone who can't move to 2017.2 (which also fixes it for us). No special options are needed and it supports Gradle as well as internal.
     
  17. Todd-Wahoske

    Todd-Wahoske

    Joined:
    Oct 23, 2012
    Posts:
    4
    Our game has very slow loading times on some (not all) Android devices.

    I'm curious to know how you discovered it was a single FBX causing the problem? Did you use a profiler to detect this?
     
  18. drolak

    drolak

    Joined:
    Jan 21, 2014
    Posts:
    49
    Sorry can't remember exactly now :( I think a saw something in the profiler that made me check our fbx files.
    We had all animations in one file and it was quite big because of that - so it was the first suspect.

    pro tip: use deep profile or profiler.begin / endSample to get more insight into what's going on.