Hacker News new | ask | show | jobs
by benmller313 2022 days ago
It's interesting, but I hate to think this might have been the response to a junior developer's suggestion to clean up unused functions in a code base.
2 comments

Dead code elimination is incredibly important for (statically linked) libraries though, usually you don't use the entire feature set of a library, and you also don't want to have the unused features end up in the executable. Traditionally this was done by building libraries from many tiny object files (e.g. one source- and object-file per function: https://github.com/ifduyue/musl/tree/master/src/stdio) since linkers would only work on 'object file granularity' and libraries are simply a container for object files, but the more recent and more flexible DCE strategies allow the same optimzation without splitting the library source code into hundreds of small files.
Really? At our company we ran out of compiler .text space and were shopping for things could remove. It depends ...
How large is your code?!