Search Unity

[Bug?] Slow instantiation of lots of addressable assets on WebGL

Discussion in 'Addressables' started by MaskedMouse, Aug 23, 2018.

Thread Status:
Not open for further replies.
  1. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I have a project with quite some addressable assets. I've split up a large FBX into lots of smaller FBX's to only get the parts of models that I currently require to show. Another reason why I've split them up into lots of bundles is because of the download buffer in WebGL that needs to be allocated. downloading 20 ~ 80x 300 ~ 2000kb parts instead of 80 ~ 100mb should save some buffer allocation as far as I understood from WebGL blogs.

    But requesting to instantiate 20 ~ 80 assets is going quite slow. The instantiation time is taking quite long.
    Even when the bundle is cached, instantiation is taking really long.
    There are no scripts on the models that execute extra code.

    The warning received while loading them:
    warning: 11 FS.syncfs operations in flight at once, probably just doing extra work


    On Windows x64 it goes quite fast, not much of a problem there. Just WebGL instantiating slowly.
    A project of a colleague of mine uses ThreeJS and there it goes a lot lot faster than Unity's WebGL.
    I kind of want to achieve a similar load time.
    Is this maybe a bug or am I missing something that makes WebGL slow?

    Going to profile a local WebGL build using Server bundles when I am back from work.

    Edit: I have now hooked the profiler onto a local build with local hosted asset bundles. As soon as I give it a go to go and load + instantiate assets it uses 44 ms (75%) to Shader.CreateGPUProgram(Standard)

    2018-08-23 21_57_11-.png

    With a little google search it brings me to this:
    https://docs.unity3d.com/Manual/OptimizingShaderLoadTime.html

    So I am going to try and build an addressable asset that contains the ShaderVariants and warm it up with that. See if that helps.

    Edit 2:
    Even with the shader warmup from the shader variant collection it still shows lots of spikes instantiating each object one by one. Is this maybe a bug in WebGL? I don't see this happening on Standalone Windows x64 builds. Atleast not as heavy as WebGL.
    They load from cache this time, since the bundles haven't changed.

    Using Unity 2018.2.5f1 (keeping it up to date as much as possible)

    2018-08-23 23_05_37-.png
     
    Last edited: Sep 5, 2018
  2. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    Am I the only one with this problem?
     
    Last edited: Sep 5, 2018
  3. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    Hi, thanks for reporting this. I'll take a deeper look and let you know what I find.
     
  4. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    Is there any update on this issue?
     
Thread Status:
Not open for further replies.