Why is a Rust executable large?
I've been playing around with a tool to answer the more generic question: why is my binary (written in C, C++, Rust, etc) so large?We use CPU profilers to tell us why our programs are slow.  My tool is intended to be a size profiler: why is my program big?It turns out there are some really interesting analyses and visualizations you can perform to answer this question.A few direct comments on the article:- I do not recommend stripping your binaries completely!  Use "strip --strip-debug" instead (or just don't compile with -g).  You should realize that debug information and the symbol table are two separate things.  The debug information is much larger (4x or more) and much less essential.  If you strip debug information but keep the symbol table, you can still get backtraces.- I don't believe -Wl,--gc-sections has any effect unless you also compile with -ffunction-sections and/or -fdata-sections, which these examples for C/C++ do not.If you care about binary size in C or C++ you should probably be compiling with -ffunction-sections/-fdata-sections/-Wl,--gc-sections these days.  Sadly, these are not the default.