finds.dev← search

// the find

johnthagen/min-sized-rust

★ 9,799 · Rust · MIT · updated Oct 2025

🦀 How to minimize Rust binary size 📦 https://github.com/johnthagen/min-sized-rust

A reference guide and example repo for reducing Rust binary sizes, covering everything from basic release flags to no_std surgery. Useful for anyone shipping CLIs, embedded targets, or WASM where binary size actually matters — not for typical server-side Rust work.

Techniques are organized from easiest/safest to most invasive, so you can stop as soon as you hit 'good enough' without reading the whole thing. Each section includes the minimum Rust version that supports the feature, which is genuinely useful when you're stuck on a stable toolchain. The build-std section with optimize_for_size and panic=immediate-abort reflects recent nightly features that most Rust size guides haven't caught up to yet. The tooling section (cargo-bloat, cargo-llvm-lines) is the right answer to 'where do I even start' — pointing at profiling before prescribing fixes.

It's a README, not a library or tool — nothing is automated, and there's no Cargo profile template you can drop in and tune. The no_main/core::fmt section is a wall of text describing a manual iterative process that will be painful for anyone not already comfortable with unsafe Rust at the ABI level. Windows coverage is thin; it just links out to a separate repo (min-sized-rust-windows) rather than integrating the material. The UPX section buries the antivirus warning in a note rather than leading with it, which is a real deployment problem in enterprise environments.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →