News for hackers. Stuff that matters.
Re:Making Rust binaries smaller by default by kobzol on Wednesday January 24, 2024 @08:38AM (#39117166)
You can't really use dead code elimination on debug symbols, because you don't know which symbols will you need. You would need to know where and how will your program crash or if the user will want to use a debugger on it.
Re:Making Rust binaries smaller by default by weinzierl on Wednesday January 24, 2024 @08:46AM (#39117261)
I don't understand. If a function isn't in the binary I will never need its name, so it does never have to be in the debug information. Likewise for variables.
Re:Making Rust binaries smaller by default by pornel on Wednesday January 24, 2024 @10:36AM (#39118561)
I think linkers don't go this far to rewrite the debug info. If libstd is used, libstd's debug info is used.

The second problem is dynamic dispatch. The overhead in "hello world" is from printing and panicking machinery (it handles closed stdout), and these features use vtables, so it's even harder to precisely analyze what's actually used and what isn't.