GeistHaus
log in ยท sign up

Why does rust binary take so much space?

users.rust-lang.org

About half of the bin size is the statically linked std, which does not get the dead code treatment from lto. You can workaround this by following the instructions here: GitHub - johnthagen/min-sized-rust: ๐Ÿฆ€ How to minimize Rust binary size ๐Ÿ“ฆ Before and after results: $ cargo build --release && strip target/release/morr && ls -l target/release/morr Finished release [optimized] target(s) in 0.10s -rwxr-xr-x 1 jay staff 286628 Apr 17 00:59 target/release/morr* $ xargo build --target x86_...

1 page links to this URL