3 ms·
A slight difference is that Rust really wants to be the top level compiler. More than a lot of languages, even C++, it really relies on link time optimization
by monocasa 7y ago
A slight difference is that Rust really wants to be the top level compiler. More than a lot of languages, even C++, it really relies on link time optimization to get the perf you'd expect.
- kccqzy 7y agoIn that case just print the command line cargo would've used to do the linking and let a different consume that and make changes. That's an easy case.
- hope-striker 7y agoHow this is more true of Rust than modern C++?
- SamReidHughes 7y agoMost "modern" C++ involves template metaprogramming of a sort that is in header file, so the modern aspect doesn't stand to increase the need for LTO that much. I would imagine that Rust programs benefit from LTO by removing static assertions necessary for memory safety that C++ programs simply omit, and by unraveling functional style code that Rust programs often get shoehorned into. Or maybe not, but that's one non-LTO that's needed.