Search Unity

WebGL.data sizes on Unity 5.5

Discussion in 'WebGL' started by rollinom, Jan 3, 2017.

  1. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    Hello I have a problem!
    I transfer my project from unity 5.2.4 to unity 5.5 and make Build for WebGL
    WebGL.data in unity 5.2 takes 48mb and in unity 5.5 50mb uncompression.
    When i statrs those build and look in broweser console/network - i see thats chrome downloads WebGL.data just 8.2 mb by unity 5.2
    and for unity 5.5 he downloads - full 50 mb WebGL.data, so builds by unity 5.5 its slower about 4 times like for me!!!
    Can anyone tell me how i can solve this problem in unity 5.5 ?
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Are you making development builds? Compression is only used in release builds.
     
  3. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    no I make release build as usual
     
  4. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    the main problem not in compression, its in how chrome download this both webgl.data
    on 5.2 app starts about 20 sec
    on 5.5 app astart more than 1 min ( because webgl.data full dpwnloads - 50 mb)
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    What did you choose as Compression Format in WebGL publishing settings in Player Settings?
     
  6. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    I set Gzip compression
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Can you post a link to your uploaded build?
     
  8. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
  9. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Your game seems to be correctly set up for compression. The data file is ~52 MB uncompressed, but is transferred compressed. It seems compression only helps a little here, bringing the size which is actually transferred down to ~43MB.

    I don't know why 5.2 would be any smaller. This may not be a WebGL specific issue at all. Do you see a size increase when building to other platforms? Can you check what uses size in the Editor.log (see here for how to do that: https://docs.unity3d.com/Manual/ReducingFilesize.html)? One thing which comes to mind is that IIRC there was a change in which Shader variants get included for "Always included Shaders" (https://docs.unity3d.com/Manual/class-GraphicsSettings.html). See if you have Shaders in there which you can remove.
     
  10. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    ok Thanks! I will make investigations to this way
     
  11. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    I make investigation and get next results:
    build by unity 5.2.4 has 17 shaders inside and I get this size :.
    If we take Unity 5.2.4 main files WebGL.data and WebGL.js
    Uncompressed size of WebGL.data = 48 MB
    Uncompressed size of WebGL.js = 27 MB
    Total uncompressed size = 75 MB
    But when it transfer by net it compressed.
    Compressed size of WebGL.data = 6 MB
    Compressed size of WebGL.js = 6 MB
    Total compressed size = 12 MB

    build by unity 5.5 I have the same number of shaders inside and I get this sizes:
    Compressed size of WebGL.data = 50 MB
    Compressed size of WebGL.js = 80 kB

    Total compressed size = 50.08 MB

    When i remove all shaders from build in unity 5.5 I get this number:
    WebGl.data to 5MB

    Also i make build by 5.5 with one "Standard" shader inside, i get huge increase of size WebGL.data - 33.8 MB

    I'm trying to understand why the same build with Unity 5.5 compression takes 44 mb more then Unity compression in 5.2.4
    Do you have any suggestion?
     
  12. sirrus

    sirrus

    Joined:
    Jun 10, 2012
    Posts:
    250
  13. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,633
    Yes, what sirrus wrote is probably the reason for the problem. The thread explains it.
     
  14. rollinom

    rollinom

    Joined:
    Feb 24, 2016
    Posts:
    9
    thanks Guys i will think what to do with it .....
     
  15. grka

    grka

    Joined:
    Jan 14, 2015
    Posts:
    80
    I have the same problem. What can I do to make the file size lower again?
     
unityunity