3 ms·
Yeah it's picking quite a lot of baggage by using the relatively short list of deps. Debug symbols stripped it clocks at 5.9M, all symbols stripped it's at 5.0
by pdimitar 4y ago
Yeah it's picking quite a lot of baggage by using the relatively short list of deps.
Debug symbols stripped it clocks at 5.9M, all symbols stripped it's at 5.0M.
Obviously this is not critical. But I have to admit I envy Zig and OCaml. :)
- mwcampbell 4y agoIf you can easily rebuild the project, I wonder what the binary size is if you add this to your top-level Cargo.toml: [profile.release] codegen-units = 1 lto = "fat" opt-level = "z" panic = "abort" Take out that last line if you need to recover from panics at runtime. So far, in my limited use of Rust, I haven't had to. Anyway, those are all the easy tweaks to reduce binary size.
- pdimitar 4y agoHad the first two already. I always prefer to optimize for speed and not size but just for the heck of it I enabled it. Wasn't super sure about the panic thing so I never used it but your comment is reassuring so I will just leave it in. From 5.0M to 3.0M, not bad! Turned the optimization for speed back on -- 4.4M! Wow.