I Minimized a Rust Binary to Under 0.5% of Its Original Size

1 ozjd 1 9/6/2025, 5:57:00 AM github.com ↗

Comments (1)

ozjd · 2h ago
I’ve been working on a project called Rusticle, which started as the default cargo new Rust app. Through aggressive size optimizations, I’ve reduced the binary to less than 0.5% of its original size — over 99.5% smaller.

It’s fully functional and runs on Windows XP (possibly even earlier versions, I'd assume Windows 2000 though untested). What’s more: it’s built using the default Rust toolchain and the MSVC linker — no nightly features, no exotic build setups.

I’m posting here because I want to push it even further. I’m already using LTO, symbol stripping, panic aborts, and other standard tricks — but I’m curious what else the community might suggest.

Are there obscure linker flags, or other techniques I haven’t considered? Bonus points if it helps with legacy Windows compatibility.

Would love to hear your thoughts — and if you’ve ever tried something similar, I’d be keen to swap notes.