Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

AssetBundle performance regression

Discussion in '2020.1 Beta' started by Hyp-X, May 21, 2020.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    I found that 2020.1.0b9 has serious asset load performance regression compared to 2019.3.13f1
    I saw something like that in the known issues, but I think this is a different issue.

    I see this on PS4 and Xbox One.
    I'm talking about a load time increase from a few seconds to half a minute.
    We load everything from lz4 compressed asset bundles.
    (I don't know if the regression affect Windows or not but even if it does it is still fast enough.)

    Are there known issues about this?
    The ones in the release notes doesn't seem to match (MacOS only, reported against 18.4 etc.)
     
    LeonhardP likes this.
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,064
    Looking at our database I can't find any obviously related issues. I've reached out to the team to check if they are aware of anything but if you could go ahead and report a bug for that, it would be greatly appreciated!
     
  3. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    I will investigate further.
    I'm no longer sure it is AssetBundle related.
    I see long pauses so I'm hoping I can capture something during that time in Razor or Pix.
     
    LeonhardP likes this.
  4. lyndon_unity

    lyndon_unity

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    55
    If you can get and share a Unity profiler capture that would also be a good first step to see what markers show up in areas of slow down.
     
  5. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    I tested after updating to 2020.1.0b10 and I see interesting results.

    upload_2020-5-28_11-39-7.png

    Here you can see 1 frame that takes 8 seconds.
    Looks like async loading is no longer async in 2020.1 ...
     
  6. lyndon_unity

    lyndon_unity

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    55
    Could you provide the unity profiler .data file so I can look at that in more detail.
     
  7. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
  8. lyndon_unity

    lyndon_unity

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    55
    Thank you. I have downloaded the capture and will take a look.
     
  9. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    Hey Hyp-X
    I looked at the capture as well and think it might be related to a change around AssetBundle.Unload API that went into b8. Can you try your project on 2020.1.0b7 and see if that restores your previous performance?
     
  10. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    Thanks for the tip, I'll check.
    (I'll have to revert to a previous version of our code, because we are depending on a crash fix arrived in b12.)
     
  11. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    Tested with b7 & b8 and I see the issue in both.
    I do believe that this happens before we call AssetBundle.Unload actually.

    It looks like that the assets that were loaded up to that point are loaded again for some reason.
    I believe this happens on PC as well, but they are loaded from disk cache (from memory) which makes it too fast to notice.

    I'll experiment a little bit more, but I might be able cut out enough assets from the project so that I can send a bugreport.
     
  12. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    I tried to cut assets that we don't load to create a testcase ...
    ... and it reduced the time of the pause
    It makes me believe that all assets are loaded from the open AssetBundles.
    We have no LoadAll calls anywhere in our codebase.

    I checked and the issue also happens on Windows build, but it takes only 346 ms. That's why I haven't noticed before.
     
  13. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    421
    And I finally arrived to the conclusion that it is NOT a Unity 2020.1 regression at all.
    Something changed in our project shortly before we switched to 2020.1
    I'm still tracking it down, but looks like the issue will not really be relevant in this part of the forum
     
    LeonhardP likes this.