You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected both of the snippets above to produce a similar-sized binary.
What did you see instead?
The one that included http package was much (5x) larger even though it was identical in function. Leaving me to believe that including packages leaves tons of "dark assembly" that is never accessed by the program itself. And after checking the binary symbol tables with nm -D, I find that the exports are the same too (none). Meaning there's a ton of unused and/or impossible-to-use cruft when compiling imported packages.
I feel as though a compiler's job is to be smart enough to not include code that won't/can't be used. Which is certainly not happening here.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Unknown
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Compiled and compared these two files:
What did you expect to see?
I expected both of the snippets above to produce a similar-sized binary.
What did you see instead?
The one that included http package was much (5x) larger even though it was identical in function. Leaving me to believe that including packages leaves tons of "dark assembly" that is never accessed by the program itself. And after checking the binary symbol tables with
nm -D
, I find that the exports are the same too (none). Meaning there's a ton of unused and/or impossible-to-use cruft when compiling imported packages.I feel as though a compiler's job is to be smart enough to not include code that won't/can't be used. Which is certainly not happening here.
The text was updated successfully, but these errors were encountered: