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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Parse times of 1MB of JavaScript of various devices

Discussion in 'WebGL' started by stephanwinterberger, Jun 26, 2017.

  1. stephanwinterberger

    stephanwinterberger

    Joined:
    Aug 22, 2016
    Posts:
    27
    On the FluentConf the web folks (again) analyzed the parsing impact of 1MB of JavaScript. Depending on the device 1MB of JavaScript can take quite long to parse. Since Unity builds are bigger than 20MB of JavaScript I wanted to ask if there are any plans to reduce build size? I also think that Web Assembly is not the silver bullet which solves all the problems. Huge builds (Web Assembly or JavaScript) will always take longer to download and to parse than optimized builds.
    (Source: https://twitter.com/HenriHelvetica/status/877924754195324928)

    Hopefully Unity build sizes will get smaller. This would be awesome for us :) (and I think for many many many other Unity WebGL users too)
     
  2. tschera

    tschera

    Joined:
    Nov 22, 2016
    Posts:
    10
    Yeah it would be interesting to hear if build size is something Unity is working on. I think small builds are crucial at the web-platform.
     
  3. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Yes, this is something we have been working on for a while. We are implementing both optimizations as well as tools that allow you to analyse the build size and choose what should/should-not be included in your build.
     
  4. tschera

    tschera

    Joined:
    Nov 22, 2016
    Posts:
    10
    @Marco-Trivellato thanks for the information! Are there any breakthroughs? Or is the engine (if you need a small part of PhysiX) still around 20mb? What are your goals you want to achieve? What are realistic expectations for the long term and also for the short term? This would be really interesting :)
     
  5. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Nothing that qualifies as a breakthrough I think

    As of 2017.1:
    • PhysX is about 5mb (uncompressed) for a release build of a simple project with a Cube (+ Collider component).
    • The build size delta between a new project and after adding the cube, is about ~1.2mb (compressed).
    • WebAssembly saves about 300kb in this scenario.
    In the short term you can expect incremental improvements. For the long term, I can't make any promise at the moment. I can just way, we will keep working on improving build sizes
     
  6. stephanwinterberger

    stephanwinterberger

    Joined:
    Aug 22, 2016
    Posts:
    27
    Okay, thanks for the information. But do you have no goal in mind which you want to achieve? I think if there is no goal to reach there will not be a real progress. Are build sizes really a concern for Unity or is it just a nice gimmick if they get smaller?
     
  7. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Build size has been a concern for some time and still is today, that's why we keep working on it. I am not mentioning any goal in terms of size because I don't want to set unrealistic expectations.
    We will share news in this area as soon as we have any.