-
Notifications
You must be signed in to change notification settings - Fork 81
Is there any way to reduce the release executable size? #627
Comments
Hey @dzcpy, You can maybe try using the strip command it could probably help. It removes the debug symbols from the binary. |
Hi @Kerollmops, thanks for your quick reply. However I'm using the following cargo config which I believe debug symboles have already been removed: [profile.release]
opt-level = 'z' # Optimize for size.
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce number of codegen units to increase optimizations.
panic = 'abort' # Abort on panic
strip = true # Strip symbols from binary* I also tried that difference between debug and release modes is only around 10M. Could you shed some light on how to further lower the size of the binary? Thanks |
Hey @dzcpy, Unfortunately, I can't help you more than that as I am not an expert on this subject. however, you can look at this guide repository which will surely help you reduce the binary size furthermore. I will close this issue as this is not something we want to prioritize any time soon. Have a nice day 🏝 |
I can purpose a solution to reduce the size of ~90% (from The solution is to ignore tokenizing for these languages I have purposed a PR here #632. This PR seems does not change the current behavior of the crate but allows the possibility to remove the support of the above languages.
|
Just for information ~85% of the size of the binary is taked by crates/lindera-ipadic which used by meilisearch/charabia/Cargo.toml#L24. |
632: Make charabia default feature optional r=ManyTheFish a=vincent-herlemont # Pull Request ## What does this PR do? Fixes [#627](#627 (comment)) Thank you so much for contributing to Meilisearch! Co-authored-by: Vincent Herlemont <vincent@herlemont.fr>
Hi, thank you for write this awesome tool. I'm currently building a software which requires the package to be within a certain size. However I just tested the example code in the readme, after relase build it takes more than 80M. Besides compressing it using something like UPX, is there anyway to reduce the executable size? Why it take so much space?
Here below is the result from running
cargo bloat --release --crates
usingcargo-bloat
The text was updated successfully, but these errors were encountered: