Open mahozad opened 10 months ago
@igordmn @AlexeyTsvetkov What do you think? I don't know if we can use a 3rd party library in our distribution-building, but maybe we can mention it as an option in the tutorial.
Before mentioning/supporting UPX, we should investigate advantages/disadvantages of it. Unpacking the compressed skiko binary in runtime theoretically can slow down the startup.
As for using 3rd party tools - it is possible to integrate them into the Compose Plugin, if the license allows it, the tool is stable and it won't cause much burden for supporting it.
@mahozad Have you encountered any critical issues when using it? I want to reduce an app's size and im looking for even the smallest optimization. Thanks!
So far, no issue for the app that I'm aware of.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Using UPX tool, size of
skiko-windows-x64.dll
file (generated in<APP_DIRECTORY>/app/
) can be reduced from 16.2 MB to 5.2 MB.A reduction of about 11 MB which is a large amount in my opinion.
I also executed UPX on the Java DLL files (in
<APP_DIRECTORY>/runtime/
) and the total size reduced from about 61 MB to about 51 MB (for JDK 17). So, overall, the app uncompressed size reduced by about 21 MB.The tool says it can be used for Linux and macOS executables as well.
Please consider including running UPX in the Gradle tasks that generate the installer or distribution.
UPX promises its results to run exactly as before, but if you think this might introduce subtle or hard-to-detect bugs, please provide an option in
compose.desktop { // ...
block for the programmer to be able to enable/disable this feature.