My first concern though is on the impact on compile times and memory usage – someone™ should probably do some experiments to try to measure these and the impact on performance so we can make some kind of intelligent decision rather than just trying stuff because it sounds good.
I definitely have better motivation for enabling LTO for Rust apps than “it sounds good” 
Actually, motivation and benefits from enabling LTO for Rust apps will be completely the same as we already have for C and C++ apps (ToolChain/LTO - Ubuntu Wiki and corresponding links from other distributions like OpenSUSE, ArchLinux, etc.): faster code and smaller binaries. C and C++ benefits is applicable here since Rust is kinda the same technology (compiled to native binaries, Rustc is based on LLVM as well as Clang, and LTO technology in GCC and LLVM ecosystem is semantically the same thing). Since motivation from faster code and smaller binaries was good enough for enabling LTO for C and C++ binaries - it should be good for Rust binaries too. Providing faster Rust binaries by default leads to better UX with such tools, and smaller binaries makes Ubuntu-based images smaller, that is useful for space-constrained scenarios (embedded-like cases and cloud containers workloads (imagine workloads with a LOT of containers).
Regarding your concerns regarding compile times and memory usage increase during the build process - they will be the same as Ubuntu already have with LTO for C and C++ packages (since LTO for Rust and LTO for C and C++ is the same thing in general). Rustc compiler (the main compiler for Rust), as well as Clang for C and C++, supports two major LTO kinds - FatLTO (aka FullLTO) and ThinLTO. I believe that Ubuntu right now uses FatLTO for C and C++. So if Ubuntu chooses FatLTO for Rust too, the build time will be increased for Rust packages twice (my personal observation based on many LTOed Rust projects - links will be provided below), and memory usage during the build process will be increased too but how much - it depends. However, I want highlight, that such change was already introduced for C and C++ packages with LTO - so it was okay. Another thing is ThinLTO - build time overhead will be much smaller (since ThinLTO allows to perform LTO in a multithreaded way) but in the price of much smaller binary size improvements and, probably, a bit less efficient code. However, choosing LTO kinds - FatLTO vs ThinLTO - is a technical decision, that we can discuss separately (but the choice should be made anyway). If some build platform are overloaded or heavily memory-constrained (things like MIPS or whatever else is supported by Ubuntu) - we can try to disable LTO for such platforms.
Some possibly useful links:
- Issue search results · GitHub - here you can find a LOT of LTO-related issues regarding enabling LTO in Rust projects. There you can see binary size improvements for a large amount of open-source Rust projects with actual numbers about binary size and compile time increase. Note that I mostly tested only FatLTO and Codegen-Units = 1 config (since it’s the most aggressive config)
- Regarding performance benches - it heavily depends on a project. E.g. if a project is IO-bound and not CPU-bound, you will see no performance improvements from LTO since LTO helps to perform more aggressive compiler optimizations targeted for CPU-heavy workloads (like better inlining). I can share with you results like this - Enable Link-Time Optimization (LTO) and codegen-units = 1 · Issue #1 · tsowell/wiremix · GitHub - but once again - it depends on the application kind. Completely the same situation as we already have with C and C++ packages.
Recommending enabling LTO and Codegen-units = 1 is not something unique for the Rust ecosystem. It’s already proposed by multiple resources, including articles/documentation from Ubuntu:
I hope I answered at least partially your questions/concerns. I don’t want to introduce LTO for Rust in some non-intelligent and blind way. It’s really a useful and powerful optimization technique that improves Rust-based binaries for Ubuntu users.
I can talk to the Rust team about this I guess!
Thanks a lot! I would appreciate if you could raise attention to this topic with right people.