Unstripped "hello world"s are ~20% bigger on my Linux system too, but it seems like the loss is much smaller on real programs, e.g. see Brad comment here:
https://github.com/golang/go/issues/6853#issuecomment-307155309 A. Il giorno giovedì 29 giugno 2017 13:38:18 UTC+2, Parker Evans ha scritto: > > Congratulations on the Beta 2 release, pretty excited to test it out. > Lots of interesting updates! > > I did notice one thing when I was playing around with Beta 1 and now Beta > 2 that I wanted to ask about. Is it expected that binary size would > increase in this release? A toy example that has been somewhat of a > benchmark in previous releases is the simple hello world program: > > package main > > import ( > > "fmt" > > ) > > > func main() { > > fmt.Println("Hello world!") > > } > > It seems like this program, when compiled with options to strip debugging > information has grown about 20% in size when compiled natively for macOS: > > go version go1.8.3 darwin/amd64 > > $ go build -ldflags="-w -s" > > $ ls -l > > total 2320 > > -rw-r--r-- 1 Parker staff 79 Jun 16 18:47 main.go > > -rwxr-xr-x 1 Parker staff 1181728 Jun 29 07:24 test > > go version devel +eab99a8 Mon Jun 26 21:12:22 2017 +0000 darwin/amd64 > > $ go build -ldflags="-w -s" > > $ ls -l > > total 2792 > > -rw-r--r-- 1 Parker staff 79 Jun 16 18:47 main.go > > -rwxr-xr-x 1 Parker staff 1424992 Jun 29 07:11 test > > Anyone have any insight on whether this is expected and if a similar > increase should be expected across the board in this release? > > Thanks, > Parker > > On Monday, June 26, 2017 at 6:11:46 PM UTC-4, Chris Broadfoot wrote: >> >> Hello gophers, >> >> We have just released go1.9beta2, a beta version of Go 1.9. >> It is cut from the master branch at the revision tagged go1.9beta2. >> >> There are no known problems or regressions. >> Please try running production load tests and your unit tests with the new >> version. >> Your help testing these pre-release versions is invaluable. >> >> Report any problems using the issue tracker: >> https://golang.org/issue/new >> >> If you have Go installed already, the easiest way to try go1.9beta2 >> is by using this tool: >> https://godoc.org/golang.org/x/build/version/go1.9beta2 >> >> You can download binary and source distributions from the usual place: >> https://golang.org/dl/#go1.9beta2 >> >> To find out what has changed in Go 1.9, read the draft release notes: >> https://tip.golang.org/doc/go1.9 >> >> Documentation for Go 1.9 is available at: >> https://tip.golang.org/ >> >> Cheers, >> Chris >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.