logoalt Hacker News

drhagen • today at 10:24 AM • 0 replies • view on HN

TFA did [0] the most important stuff for minimizing Rust binaries: release mode, LTO, strip, and abort on panic. But there is a lot more you can do if you really care about Rust binary size [1]: remove location details, purge the debug formatters, rebuild the standard library for size, abort with no error message at all, and nuttier stuff.

[0]: https://github.com/zion-sati/NetWasm/blob/main/docs/size-and...

[1]: https://github.com/johnthagen/min-sized-rust