Binary Size
September 10, 2024 ยท View on GitHub
The binary size comparisons were run on an Intel(R) Core(TM) i7-6560U CPU @ 2.20GHz processor, on Linux 5.12.5/Fedora 34, and run against commit 8406144. The Rust compiler version was rustc 1.55.0-nightly (b41936b92 2021-07-20).
Each binary is generated using all optimization levels, and includes the result before and after stripping, with the core functionality black-boxed, to ensure optimization does not optimize-out the result.
All these binaries sizes are relative to the size of an empty Rust binary: that is, the size of the empty executable is subtracted from the total binary's size. For some cases, this leads to results of 0 bytes, which isn't real, but in practice leads to no additional size in the resulting executable.
Default
Optimization Level "0"
Optimization Level "1"
Optimization Level "2"
Optimization Level "3"
Optimization Level "s"
Optimization Level "z"
Compact
Optimization Level "0"
Optimization Level "1"
Optimization Level "2"
Optimization Level "3"
Optimization Level "s"
Optimization Level "z"