min-sized-rust is a practical, research-oriented repository that demonstrates how to aggressively reduce the size of compiled Rust binaries through a combination of compiler flags, linker optimizations, and code-level techniques. By default, Rust prioritizes performance, debuggability, and compile speed, which often results in relatively large binaries, especially in debug mode or when including standard libraries. This project systematically explores how to invert those priorities, focusing instead on minimizing output size for use cases such as embedded systems, WebAssembly, and constrained deployment environments. It provides concrete examples and configurations showing how to strip symbols, reduce panic overhead, optimize linking, and eliminate unused code paths. The repository also highlights trade-offs between size, performance, and safety, helping developers understand the implications of each optimization step.
Features
- Techniques for minimizing Rust binary size through compiler and linker settings
- Examples comparing debug vs release builds and their size impact
- Use of stripping, LTO, and panic optimization strategies
- Guidance on reducing dependency and standard library overhead
- Focus on embedded, WASM, and constrained environments
- Step-by-step configuration for reproducible minimal builds