Parse times of 1MB of JavaScript of various devices

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 :slight_smile: (and I think for many many many other Unity WebGL users too)

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.

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.

@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 :slight_smile:

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

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?

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.