3 ms·
You might not care to shrink it down for 500KB to 200KB. But shrinking 200MiB binary to 40MiB is nice. See also: https://en.wikipedia.org/wiki/Wirth's_law http
by Peaker 10y ago
You might not care to shrink it down for 500KB to 200KB. But shrinking 200MiB binary to 40MiB is nice.
See also: https://en.wikipedia.org/wiki/Wirth's_law https://en.wikipedia.org/wiki/Wirth's_law
- WalterGR 10y agoBut shrinking 200MiB binary to 40MiB is nice. Is that the average size savings?
- Normal_gaussian 10y agoYou can make that kind of saving quite easily if you are statically linking a load of stuff together. Often the extra libs have a whole set of features you don't need and didn't realise were so large.
- FnuGk 10y agoShould the linker not throw away dead code?
- phaedrus 10y agoIt depends on the linker and the command line options to the compiler and the linker. I was surprised to find out that, e.g., GCC, has this off by default and you have to pass options to enable it.
- Peaker 10y agoNormally, if you use archive (.a) files, then any .o files within them that are not needed, are thrown away. But that is at .o file granularity. There's no per-symbol dead code elimination. And if you provide a list of .o files (no .a files) then it doesn't throw away anything at all.