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.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

How to make the bundle load smoother?

Discussion in 'WebGL' started by hromoyDron, Jan 30, 2018.

  1. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    90
    Hello!

    I load bundles through UNITY AssetBundleManager.
    Bundles loading is async.
    But in profiler I get one big spike when load bundle.

    Average fps in webGL build is 60. But in spike fps sags to 15.

    I want loading to be longer, but without big spikes.
    (for example 4 spikes to 30fps instead 1 to 15fps)

    Is it real?

    I use Unity 2017.3 and webGL build.


    (on image one awful big spike)

    It's worth noting that I download small bundles witch loads for 0.05 - 0.5 seconds, but cause this spike.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    could you try uncompressed bundles? (if that solves the spike, you could manually gzip them and set your server accordingly)
     
  3. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    90
    So I tried LZMA, LZ4 and uncompressed format.
    (as I understand WWW.LoadFromCacheOrDownload in automatically understand compression format and I shouldn't change anything except bundles files)

    And despite changing the compression format resulting is the same.
    Results for both variants have big variance values. From 35 to 70 ms.

    Bundle: 628kb compressed, 1,1mb uncompressed. Dependences = 0;

    Result without compression

    Result with compression



    So Application.Preload assets take very much time. (also it depends on the size of bundle)

    How to remove this big spike and get 35-40 guaranteed fps on bundle load?