-
Notifications
You must be signed in to change notification settings - Fork 65
Conversation
Signed-off-by: Chojan Shang <[email protected]>
Normally, the size on macos is already very small and no additional work is required |
Interesting. @PsiACE could you elaborate a bit with the underneath. I'm curious about how this works. |
I will explain a little later |
This looks like magic to me, would like to know some details too :) |
@PsiACE @huachaohuang we're starting the normal development cycle and it seems this PR should be rebased onto master. It's still interesting to know the underneath this trick works for we may want it now or later. |
The technique looks interesting to me. But maybe this is premature optimization. Maybe we can consider it when we have trouble with the binary size. |
Sorry I'm late. Rust generates an absolutely massive amount of debug info by default. One easy workaround is to compress the debug info sections, on Linux with a
Some other optimizations from a tutorial min-sized-rust . Please check for more information. It is worth mentioning that
After investigation, it hardly adds much to the compilation time. If necessary, the number of codegen-units can be set for the specific crate, like
|
If this project goes well, we'll need it soon. Whether you intend to provide the binary to users or use docker, 90% reduction in release size means only tens of megabytes of space are needed |
It conflicts with the main branch, if necessary, I will reopen a new PR |
@PsiACE thanks for your contribution and explanation, I suggest that we can evaluate this optimization when we have a large enough binary. |
for x86_64-unknown-linux-gnu
Signed-off-by: Chojan Shang [email protected]