# Build size. Auto Stripping or manual configuration

**URL:** <https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819>\
**Category:** Feature requests (USE GITHUB)\
**Created:** [May 10, 2016, 9:35am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819 "2016-05-10T09:35:34Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![baturinsky](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/baturinsky/32/2023_2.png) [@baturinsky](https://forum.defold.com/u/baturinsky)\
**Post date:** [September 12, 2016, 3:13pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/21 "2016-09-12T15:13:25Z")

</div>

If I understand right, Defold game on HTML5 is not a “real” js program, but asm.js contraption interpreting lua. I can see how that bloats build size and slows down it’s execution.

Ideally (for me) Defold would use something like Haxe that converts to different languages, but that would probably make developing and supporting it way harder.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [September 12, 2016, 3:34pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/22 "2016-09-12T15:34:33Z")

</div>

About build size : 5.3 Mb - it is full version, gzipped version is something about 1.3 Mb.

About “real js”, I don’t know exactly but I think you right, maybe @sven or somebody else can explain this.

---

<div class="post-metadata">

**Author:** ![baturinsky](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/baturinsky/32/2023_2.png) [@baturinsky](https://forum.defold.com/u/baturinsky)\
**Post date:** [September 12, 2016, 3:36pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/23 "2016-09-12T15:36:45Z")

</div>

Speaking of gzip. Maybe Defold game can have most of itelsf gzipped and inflate itself to reduce install size?

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [September 12, 2016, 3:44pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/24 "2016-09-12T15:44:09Z")

</div>

Looks like new feature request - and I think it’s a great idea! =)  
Maybe you can create new feature request and let’s see what’s developers team thinking about it?

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [September 12, 2016, 6:59pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/25 "2016-09-12T18:59:34Z")

</div>

If you use [https://www.s-cdn.com/](https://www.s-cdn.com/) the engine runtime files are gziped among other advantages.

68 % savings on the loader (just tested 1.2.88).  
77 % savings on the engine runtime - original size: 5238402, compressed size: 1195195 (just tested 1.2.88).  
Loading will be faster based on geolocation.  
If someone already has the files cached it means instant loading for the engine runtime files, and only time spent loading the game.darc.

---

<div class="post-metadata">

**Author:** ![Kruithne](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/kruithne/32/1531_2.png) [@Kruithne](https://forum.defold.com/u/Kruithne)\
**Post date:** [September 12, 2016, 10:47pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/26 "2016-09-12T22:47:26Z")

</div>

Kind of related, but not about HTML5 builds. Is there a reason why the Linux build is so massive compared to OSX (Darwin) and Windows?

**With a generic test build:**

- Win32: 2.11 MB (2,170 KB)
- Darwin: 2.29 MB (2,355 KB)
- Linux: 13.9 MB (14,253 KB)

That puts the Linux build at **6** times larger than the OSX one, and **6.5** times larger than the Windows one.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [September 12, 2016, 11:56pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/27 "2016-09-12T23:56:05Z")

</div>

Historically the Linux runtime has always been bigger. You can see the sizes here [http://d.defold.com/stable/](http://d.defold.com/stable/) (would be cool to batch check and chart the sizes of all targets based on these files). I assume it’s built in dependencies to make it more portable between the different versions of Linux? The good news is Linux runtime compresses to just 6MB. Desktop file sizes are not as much as a concern honestly. In fact, larger file sizes generally give users more confidence in value.

---

<div class="post-metadata">

**Author:** ![Ragnar\_Svensson](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/b5ac83/32.png) [@Ragnar\_Svensson](https://forum.defold.com/u/Ragnar_Svensson)\
**Post date:** [September 13, 2016, 7:26am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/28 "2016-09-13T07:26:55Z")

</div>

Regarding the executables, we want to keep them small and uncompressed to maximise app start time (as well as minimise complexity). The linux version is currently an exception to this, mostly because the opt settings we started to use for gcc made massive unrolling of loops, thereby increasing the size _a lot_. It’s roughly 10 MB larger than it should be. The HTML5 version can be gzipped by web servers, like in @Pkeod’s case.  
Regarding content, we use great compressions like webp for textures. Different platforms have also strategies for compression as a part of bundling, like apks for android.  
It’s not as easy as blindly gzipping everything, as it affects other things like start time. It’s often better to look at what is taking up the space and fixing that specifically.  
If you have a problem with install sizes, please post it here in the forum and describe the specific case.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [September 13, 2016, 7:32am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/29 "2016-09-13T07:32:23Z")

</div>

I think linux/mac/win build size doesn’t matter, because on desktop user all time have a good internet connection and disk free space much more than on mobile.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 13, 2016, 10:38am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/30 "2016-09-13T10:38:29Z")

</div>

> [@Pkeod](#):
>
> would be cool to batch check and chart the sizes of all targets based on these files

I had a semi-finished script that did just this. You reminded me to finish it! Enjoy:

[https://github.com/britzl/dmengine\_size](https://github.com/britzl/dmengine_size)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [October 11, 2016, 7:56pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/31 "2016-10-11T19:56:39Z")

</div>

Updated to 1.2.90:

 ![](https://forum-defold.b-cdn.net/uploads/default/original/2X/1/15bba24d84cdc214e213c9f24d960921f3dc9e4f.png)

> **[GitHub - defold/build-size: Graph showing the Defold engine and editor sizes...](https://github.com/defold/build-size)**
>
> Graph showing the Defold engine and editor sizes for all supported platforms

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [October 16, 2016, 10:10am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/32 "2016-10-16T10:10:10Z")

</div>

stability 🤓

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/c/c3ef9ec59644983b1b230a9d59d524797fbc9a7e.png)  
[google doc link](https://docs.google.com/spreadsheets/d/1V5yblO4Vm90nCG8Jmd1d4w1za6l_6eucgiaEwbPyBFk/edit#gid=0)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [November 22, 2016, 6:54am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/33 "2016-11-22T06:54:28Z")

</div>

Updated to 1.2.93:

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/3/3594a1ed785fd11f77a31076475f6113bf8b3281.png)

A very very slow upwards trend, but not much to worry about considering the new features that have been added in recent releases.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [December 5, 2016, 7:28pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/34 "2016-12-05T19:28:58Z")

</div>

![](https://forum-defold-uploads.b-cdn.net/original/2X/1/12c364ef920ae57a9f229987454ddbfe7beaac15.png)

P.S.: And this post not about build size in new versions. it’s reminder about need of stripping functionality:

> [@AGulev](#):
>
> I think, will be great to have new feature auto stripping or pre configurated with possibility turn off unneeded modules (like in cocos2djs).

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 5, 2016, 9:09pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/35 "2016-12-05T21:09:51Z")

</div>

Updated to 1.2.94:

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/3/363f6ec6850297756663d5f7d9bfd63e73c48847.png)

---

<div class="post-metadata">

**Author:** ![secretmapper16](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/secretmapper16/32/2542_2.png) [@secretmapper16](https://forum.defold.com/u/secretmapper16)\
**Post date:** [December 6, 2016, 12:49am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/36 "2016-12-06T00:49:26Z")

</div>

Just chiming in a bit, as I seem to have come from the same background as @AGulev.

For most game portals, something upwards of 5mb is a complete dealbreaker for sponsorships. Unfortunately the size has to be taken into account before gzip. Optimizations like keeping the actual engine separate in a CDN is generally just not an option supported by most portals.

As an html5 game developer who relies on sponsorships, I would be less inclined to start any project in Defold because of this. I’m still enjoying Defold, but is commercially unviable for me as a tool for html5 web based games.

I think support for manual/auto stripping would be great - in the game I’m working on, I’m using my own custom physics/collision detection engine (just a simple uniform spatial grid) and would be able to do without the hefty box2d engine.

I know that the defold team is probably already weary of this and are doing their best to keep the size low. However, seeing as we’re writing on Lua and the runtime is probably included in the build, that might be where the bulk of the payload size is and would thus never become negligible.

TLDR - size is quite non-negotiable for game portals. Gzip/CDNs is not a factor we can rely on. As it stands, the runtime is just too big to use right now for this use case.

Sorry if my comment is just a bit of a reiteration of most of the comments, but I just felt like I needed to emphasize just how non-negotiable size is for game portals, and is a problem we can’t work around.

Personally, due to how Defold is (3d engine + non-js), I feel like this would always be this big, so it’s just not a fit for games relying on sponsorships. Which is **okay** , since I think it can fit other niches. I’m of course optimistic as the tech improves.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 6, 2016, 6:06am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/37 "2016-12-06T06:06:50Z")

</div>

> [@secretmapper16](#):
>
> However, seeing as we’re writing on Lua and the runtime is probably included in the build, that might be where the bulk of the payload size is and would thus never become negligible.

Lua is a very small language and it is built to be embeddable in systems with very limited resources. From [Lua.org - \> About](https://www.lua.org/about.html):

“Adding Lua to an application does not bloat it. The tarball for Lua 5.3.3, which contains source code and documentation, takes 288K compressed and 1.1M uncompressed. The source contains around 24000 lines of C. Under 64-bit Linux, the Lua interpreter built with all standard Lua libraries takes 245K and the Lua library takes 420K.”

The physics systems (2D and 3D) takes up a significant amount of space, and probably some other parts of the engine as well but I don’t have any exact numbers.

> [@secretmapper16](#):
>
> Sorry if my comment is just a bit of a reiteration of most of the comments, but I just felt like I needed to emphasize just how non-negotiable size is for game portals, and is a problem we can’t work around.

Don’t be sorry! We understand that this is important to you! There is also a lot of internal requests here at King for both stripping parts of the engine and for streaming parts of the game content. Even if we are not in the exact same situation when publishing games on Facebook as on other HTML5 game portals we are driven by the same desire to have a small initial download. In our case we might wish to get the players into the game straight away on first play and while playing we can download maps and other parts of the game.

I’d say that we have four main tracks going on right now in the team:

1. The new editor
2. Improved 3D support
3. Streaming API
4. Extensions

This means that we are addressing this issue right now but it is not a trivial thing to solve. Sometimes I think to myself “why is feature X taking so long?” but then I remind myself that we’re never doing anything half-assed. When we release a new feature for the engine it should be extremely well designed and built to last and be backwards compatible forever. This is one of our promises to you that we will never break anything you have created in the past. And with that in mind we need to design things well.

I believe @jakob.pogulis is the one with most knowledge of our plans around streaming of game content. @jakob.pogulis, would you mind sharing some additional information regarding this?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 20, 2016, 8:05am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/38 "2016-12-20T08:05:12Z")

</div>

Info regarding our work with streaming of game content is described here: [Apk-expansion files - #12 by jakob.pogulis](https://forum.defold.com/t/apk-expansion-files/195/12)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 20, 2016, 8:06am UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/39 "2016-12-20T08:06:48Z")

</div>

Updated to 1.2.96:

[![](https://defold-forum-bucket.nbg1.your-objectstorage.com/original/2X/8/8be2bd2f66b64259381dbe073ef9bac66ee26148.png)](https://github.com/britzl/dmengine_size/blob/master/report.csv)

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [February 19, 2017, 3:48pm UTC](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819/40 "2017-02-19T15:48:38Z")

</div>

1.2.97 👌.  
2 big major features ans small affect to build size

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/1/17098e42161b40e297c6643fb6d25febe79fef91.png)  
[https://docs.google.com/spreadsheets/d/1V5yblO4Vm90nCG8Jmd1d4w1za6l\_6eucgiaEwbPyBFk/edit#gid=0](https://docs.google.com/spreadsheets/d/1V5yblO4Vm90nCG8Jmd1d4w1za6l_6eucgiaEwbPyBFk/edit#gid=0)

[Previous page](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819.md?page=1)

[Next page](https://forum.defold.com/t/build-size-auto-stripping-or-manual-configuration/1819.md?page=3)
