New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize build size #1781
Optimize build size #1781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum... I am not sure about that but the backtrace i.e. RUST_BACKTRACE=1
will not work anymore, am I right? If I'm wrong and the backtrace can always be displayed correctly without having to specify the debug = true
in the Cargo.toml file, I would gladly approve this PR.
Yeah not sure either we want to remove the debug symbol; when a user encounters an unknown panic, the symbols/backtrace can give us a hint at what is going wrong 😬 |
@Kerollmops none of the distribution of meilisearch comes with the but not when the binary is stripped. I think we can put aside stripping for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we can still see the panics I'm ok with this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, as we see the panic backtraces, I approve this!
Here is a screenshot of a panic before this PR: Now a screenshot with this PR: And finally, a screenshot of what we would have if we stripped + compressed the binary with @Kerollmops do you still think this is ok?
(I took every screenshot with the option |
That's no true, sometimes it panics in a function that is not quite useful (inside of |
So are we sure we want to merge this PR as-is? |
What is the size gain for this PR, already? |
On my computer, without this PR, the binary weight 326MB, and with this PR it's only 35MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a lot! maybe we can merge this. I think that the backtrace we got without all of the line numbers is enough to debug.
bors merge |
Remove debug symbols from the release build, and strip the binaries.
We used to need to debug symbols for sentry, but since it was removed with #1616, we don't need them anymore.
Shrinks the binary size from ~300MB to ~50MB on linux.