The post explores the process of reducing the size of a Rust binary and compares it to an assembly version. It discusses various techniques, such as stripping symbols, optimizing build profiles, and removing dependencies on the standard library. The final binary size achieved is 400 bytes.
Table of contents
Starting point: 3.6 MiBThe biggest gain is strip: 300 KiBEasy but modest gains: 260 KiBlibc instead of the standard library: 16 KiBHow small should it be? The assembler version is 352 bytes.No libc either: 13 KiBLinker flags: 400 bytesUpdate: Bigger programsConclusionSort: