Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Loading speeds

Discussion in 'Asset Bundles' started by unity_3D1F2458AB75386BB89A, Nov 1, 2023.

  1. unity_3D1F2458AB75386BB89A

    unity_3D1F2458AB75386BB89A

    Joined:
    Aug 16, 2022
    Posts:
    11
    I have a bundle with meshes and models, after building bundles (I am building using BuildPipeline) with Chunk based compression I get a resulting bundle of 6.5 Mb.
    It takes me whole 11 seconds to load the bundle, even in my M1 Mac Pro. Which is way more then I would like it to be. Is there a way to know what takes the bundle such long time and optimize it?
     
  2. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    76
    Hey,

    Have you tried using the Unity Profiler at all?
     
  3. unity_3D1F2458AB75386BB89A

    unity_3D1F2458AB75386BB89A

    Joined:
    Aug 16, 2022
    Posts:
    11
    I did not, but I did some logging, and found out that I am loading a lot of assets simultaneously, ~700 ish. So I limited the number of loading assets to 30 at the same time, and it helped with loading speeds a lot
     
  4. unity_3D1F2458AB75386BB89A

    unity_3D1F2458AB75386BB89A

    Joined:
    Aug 16, 2022
    Posts:
    11
    So, an update: I've limited number of simultaneous files, introduced a loading queue, and loading times are reasonable now. Currently, no bundle takes longer than a second.

    Still, I'd like to optimize loading times of individual assets. Currently, I'm loading at most 30 assets at the same time, my quality settings: Time Slice: 32, Buffer size: 64. With that setup, individual assets can take up to 2 seconds to load from bundle, so I am still looking at what I can do

    I know about existence of Application.backgroundLoadingPriority and AssetBundle.memotyBudgetKB, but those had no effect on loading speed

    I monitored loading using Profiler, but it hasn't provided any good leads
     
  5. daniel_keepsake

    daniel_keepsake

    Joined:
    Aug 5, 2021
    Posts:
    1
  6. unity_3D1F2458AB75386BB89A

    unity_3D1F2458AB75386BB89A

    Joined:
    Aug 16, 2022
    Posts:
    11
    Actually, since the last time I found out that I was keeping all prefab dependencies in the asset bundles as available to be loaded. Once I changed the bundles so that only the assets that should be loaded are exposed, and everything else is just a dependency and sits in project folder - my speed went waaaaay up
     
    AndrewSkow likes this.