- Home /
Unity 3.5 NaCl output includes unity.nexe over 35 MB?
Just a very simple ball drop test for NaCl output and the resulting file was over 35MB! Is there a way to optimize file size for WebPlayer NaCl or is it supposed to always be with so much baggage?
Answer by jonas-echterhoff · Jan 05, 2012 at 08:59 AM
The unity.nexe file contains the uncompressed unity executable. You can expect this to be compressed some way when actually downloaded by the user. Currently, there are two ways to serve nacl content on the Chrome Web Store. Either as a packaged or hosted app. If you are publishing as a packaged app, all the data will be compressed into a .crx archive, and will only be downloaded once on the first install. Unfortunately, right now, the .crx will always contains all the data, so the user will download both, i686 and x64 executables even though only one is needed. Google is working on a fix to that.
If you are publishing as a hosted app, the data files will be hosted on your own http server. Most http servers include an option to compress files as they are transmitted. If you are using Apache, this should just work, as the unity_nacl_files folder created by Unity contains an invisible ".htaccess" file, which configures Apache to serve the nexe and so files compressed. So the total amount of data actually downloaded for the unity engine should be around 10 MB for Unity 3.5b6.
Answer by Dreamora · Jan 03, 2012 at 11:20 PM
this is normal.
For one this is only a Developer Preview, not the final 3.5 so things are still in work. The other thing is that the compressed crx files streaming gziped which you distributing on the chrome webstore etc are only a fraction of it (around 1/10th normally)
if webplayers wouldn't be lzma compressed they would be this large too basically.
also keep in mind that NaCl includes the unity engine, while webplayers have it installed on the system (webplayer plugin) so they will always be larger than unity.
Answer by Waz · Jan 22, 2012 at 11:54 PM
But if these are common files, why not just host them in a single place (eg. on unity3d.com) so that they have some hope of being in the user's cache? Or is the idea that this is only for Google WebStore?