This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust complilation to reduce release binary size
I'm still having cargo optimize for speed, but have configured the following tweaks: - Enable Link Time Optimization (LTO) - Reduce Parallel Code Generation Units There's no way to have cargo strip the binaries automatically, but using the following command will handle it for you: $ RUSTFLAGS='-C link-arg=-s' cargo build --release Putting these changes into place shouldn't affect the speed or behavior of the released binary, but it does increase the compilation time. For size reference, no optimizations resulted in a binary that was ~4.8M,and after these steps, the binary is ~1.8M (a savings of over 60%). See: - https://github.com/johnthagen/min-sized-rust - rust-lang/cargo#3483
- Loading branch information