Go 1.9 Beta 2 is released

2091 views
Skip to first unread message

Chris Broadfoot

unread,
Jun 26, 2017, 6:11:46 PM6/26/17
to golang-nuts
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:

If you have Go installed already, the easiest way to try go1.9beta2
is by using this tool:

You can download binary and source distributions from the usual place:

To find out what has changed in Go 1.9, read the draft release notes:

Documentation for Go 1.9 is available at:

Cheers,
Chris

Parker Evans

unread,
Jun 29, 2017, 7:38:18 AM6/29/17
to golang-nuts
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

alb.do...@gmail.com

unread,
Jun 29, 2017, 8:19:29 AM6/29/17
to golang-nuts
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:


A.

alb.do...@gmail.com

unread,
Jun 29, 2017, 8:21:18 AM6/29/17
to golang-nuts
But if you have other numbers please share them, it'll certainly interesing
to see them.


Il giorno giovedì 29 giugno 2017 13:38:18 UTC+2, Parker Evans ha scritto:

Parker Evans

unread,
Jun 30, 2017, 7:16:29 AM6/30/17
to golang-nuts
It is certainly a micro-benchmark.  I just wanted to ask in case it was expected since I use golang on ARM based embedded systems a lot and they tend to be sensitive to binary size.  In the tests, my binary is stripped (-ldflags="-w -s"), so I wouldn't think the size difference is related to the changes that were made to add additional DWARF info, etc.  When I checked the cross compiled Linux ARM 7 sizes for the hello world program, they are also up in go1.9 beta.

go version go1.8.3 darwin/amd64


$ GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-w -s"

dozer2:test Parker$ ls -l

total 1824

-rw-r--r--  1 Parker  staff      79 Jun 16 18:47 main.go

-rwxr-xr-x  1 Parker  staff  928608 Jun 30 06:37 test


go version devel +eab99a8 Mon Jun 26 21:12:22 2017 +0000 darwin/amd64


$ GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-w -s"

$ ls -l

total 2176

-rw-r--r--  1 Parker  staff       79 Jun 16 18:47 main.go

-rwxr-xr-x  1 Parker  staff  1107256 Jun 30 06:36 test


Checking the hello world HTTP server program:

package main


import (

        "net/http"

)


func main() {

        http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {

               w.Write([]byte("Hello world!"))

       })

       panic(http.ListenAndServe(":8080", nil))

}


The size is also up a bit from go1.8 -> go1.9 on both darwin amd64 and linux_arm (7), though a smaller percentage than the basic hello world.

go version go1.8.3 darwin/amd64

$ go build -ldflags="-w -s"

$ ls -l

total 8344

-rw-r--r--  1 Parker  staff      204 Jun 30 06:44 main.go

-rwxr-xr-x  1 Parker  staff  4264852 Jun 30 06:47 test


$ GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-w -s"

$ ls -l

total 6344

-rw-r--r--  1 Parker  staff      204 Jun 30 06:44 main.go

-rwxr-xr-x  1 Parker  staff  3242224 Jun 30 06:48 test


go version devel +eab99a8 Mon Jun 26 21:12:22 2017 +0000 darwin/amd64

$ go build -ldflags="-w -s"

$ ls -l

total 8880

-rw-r--r--  1 Parker  staff      204 Jun 30 06:44 main.go

-rwxr-xr-x  1 Parker  staff  4538852 Jun 30 06:45 test


$ GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-w -s"

$ ls -l

total 6664

-rw-r--r--  1 Parker  staff      204 Jun 30 06:44 main.go

-rwxr-xr-x  1 Parker  staff  3405040 Jun 30 06:46 test


I can check it out for bigger/more realistic programs as well.

~Parker
Reply all
Reply to author
Forward
0 new messages