I'm working on a Go program in a severely constrained environment and found that I can save 680 KiB of disk (and disk == RAM in this environment) by making sure x/net/idna is never imported (even if unused).
That is, the init tasks for x/net/idna and its deps don't layout in memory such that the linker can discard enough:
I'm working on a Go program in a severely constrained environment and found that I can save 680 KiB of disk (and disk == RAM in this environment) by making sure x/net/idna is never imported (even if unused).
That is, the init tasks for x/net/idna and its deps don't layout in memory such that the linker can discard enough:
It adds 680KiB to binary compared to just the
println("hi")
line without the import.Linker says:
/cc @randall77 @mpvl @rsc @ianlancetaylor