Replies: 1 comment 8 replies
-
|
Hey, last time I checked most of the size came from Skia, which I don't think I can do much about it.
Is it possible to know what libraries?
You could try bundling your app using |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For the minimal project below, I could confirm that the
cargo build --releasebinary size is no less than 20MB under Linux-x64After inspecting the output file, I could confirm that
.rodatasection is taking up the largest amount of the file size followed by the.textsectionobjdump target/release/freya-intro --headers --section .textobjdump target/release/freya-intro --headers --section .rodataFollowed by that, I used
upxto reduce the final binary size even furtherupx --best --overlay=strip -o target/release/freya-intro-compressed target/release/freya-introUnfortunately, It's having a negative side effect on RAM usage (already doubling)

After that, I had to
objdumpcontent for both.textand.rodatasections for further inspectionAnd I could confirm that
.rodatais containing several occurrences of useless textual data which should be useful when debugging due to some absolute paths referencing the development machine(e.g: /home/username/.cargo/registry/src/index.crates.io-.......)I conclude that some unnecessary content related to development is getting linked into the
.rodatasection of the release build, and discarding it may help reduce both the final binary size and even ram usage.I understand that content inside
.rodatasection should be discarded before the link step. probably some inner libraries are keeping this content regardless of release build optimizations.Question: How to get rid of the extra content and reduce the final binary size even further by a large margin?
Beta Was this translation helpful? Give feedback.
All reactions