Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: linhdinh on November 15, 2015, 02:21:14 PM

Title: DOTween adds 5M to IL2CPP builds
Post by: linhdinh on November 15, 2015, 02:21:14 PM
I am using unity 5.2.0f1 and DOTween v1.0.800 DOTween PRO 0.9.290. With blank project, the IL2CPP build is 8.2MB for universal architecture. Only adding DOTween the final build jumps to 14.5MB.

It's too much. How can I reduce the build size of DOTween?

Title: Re: DOTween adds 5M to IL2CPP builds
Post by: Daniele on November 15, 2015, 04:48:10 PM
Hi,

I can't test IL2CPP builds directly, but that seems extremely wrong and weird. All DOTween and DOTween Pro build files are a total of just 245kB (inside Unity Editor they have more weight, but only for editor stuff: most of the files are not considered for builds).

What I think is happening, is that Unity creates a blank build (without Unity GUI libraries and probably some UnityEngine stuff) if you don't import anything at all, but importing DOTween "activates" Unity itself, and so it creates a real empty project after that. Can you try recreating a blank project, then creating a blank scene just with some cubes and a couple UI elements, and exporting it again?

Cheers,
Daniele
Title: Re: DOTween adds 5M to IL2CPP builds
Post by: linhdinh on November 16, 2015, 03:24:35 AM
I create a blank project, containing only dlls & scripts from DOTween lib. Here is editor log:

Code: [Select]
Mono dependencies included in the build
Dependency assembly - Mono.Security.dll
Dependency assembly - System.Core.dll
Dependency assembly - System.dll
Dependency assembly - mscorlib.dll
Dependency assembly - UnityEngine.UI.dll
Dependency assembly - UnityEngine.Networking.dll
Dependency assembly - DOTween.dll
Dependency assembly - DOTween43.dll
Dependency assembly - DOTween46.dll
Dependency assembly - DOTween50.dll
Dependency assembly - DOTweenPro.dll
Dependency assembly - DemiLib.dll
Dependency assembly - Assembly-CSharp.dll

Textures      0.0 kb 0.0%
Meshes        0.0 kb 0.0%
Animations    0.0 kb 0.0%
Sounds        0.0 kb 0.0%
Shaders       93.2 kb 1.7%
Other Assets  0.4 kb 0.0%
Levels        401.3 kb 7.2%
Scripts       1004.0 kb 18.1%
Included DLLs 3.9 mb 72.8%
File headers  8.5 kb 0.2%
Complete size 5.4 mb 100.0%

Used Assets, sorted by uncompressed size:
 93.4 kb 1.7% Resources/unity_builtin_extra
 4.0 kb 0.1% /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
 1.6 kb 0.0% /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll
 0.3 kb 0.0% Assets/Demigiant/DOTweenPro/DOTweenPro.dll
 0.2 kb 0.0% Assets/Demigiant/DOTween/DOTween.dll
 0.1 kb 0.0% /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll
 0.1 kb 0.0% /Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll
 0.1 kb 0.0% Assets/Demigiant/DOTweenPro/DOTweenAnimation.cs
Title: Re: DOTween adds 5M to IL2CPP builds
Post by: Daniele on November 17, 2015, 11:22:36 AM
Hi,

I investigated some more, and this still seems very very weird. Could you open a bug report with Unity with your example? DOTween is a very lightweight library, that only uses basic system classes available in regular Unity projects. If IL2CPP really is increasing 245kB to 6MB that seems like a pretty big issue on Unity's side, which I suppose they're working on fixing (considering that IL2CPP is still beta).

Let me know.

Cheers,
Daniele
Title: Re: DOTween adds 5M to IL2CPP builds
Post by: linhdinh on November 19, 2015, 03:59:21 PM
I filed bug report to Unity team. App size is really important for us. I'd appreciate if you find a workaround for this issue.

Thanks,
Linh
Title: Re: DOTween adds 5M to IL2CPP builds
Post by: Daniele on November 19, 2015, 04:03:12 PM
Thanks, let me know what they have to say. I'm afraid I don't have any workaround. I payed special attention at not using any special .NET libraries with DOTween, exactly to keep the weight minimal. If Unity is increasing it so much it can only be a bug with DLL conversion to IL2CPP, and I'm afraid there's nothing I can do on my side :/