Skip to content
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 release size. #24

Closed
wants to merge 1 commit into from
Closed

Conversation

yamafaktory
Copy link

Based on https://github.com/johnthagen/min-sized-rust.

Before

cargo build --release
du target/release/sd
2.0M    target/release/sd

After

cargo build --release
du target/release/sd
1.7M    target/release/sd

➡️ Another good optimization would be to strip the symbols from the binary:

strip target/release/sd 
du target/release/sd   
1.1M    target/release/sd

@chmln
Copy link
Owner

chmln commented Jun 18, 2019

@yamafaktory thanks for your contribution :)

While small binary size is a noble goal, I believe that by optimizing for size during compilation we forego optimizing for performance.

Something like strip is nice but it's a lot of extra work to do this on our side. I'd rather wait for rust-lang/cargo#3483. Not to mention most Linux distros already do this automatically.

@yamafaktory
Copy link
Author

Hi @chmln,
Thanks for the feedback! Should we close this PR?

@chmln
Copy link
Owner

chmln commented Jun 18, 2019

@yamafaktory Yes. If you have any other ideas on how to improve sd, you're always welcome to open up an issue for discussion. Thanks again for putting in the time for the patch.

@chmln chmln closed this Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants