Monday 6 February 2017

Improvements in go 1.8

This post represents notes collected on the new go release and from the state of go talk of Feb 2017, on changes in go 1.8.

Video of the talk can be found here.
Slides of the talk can be found here.


 General Improvements

  • ignore struct tags in type conversions (easier type conversions)
  • 32-bit mips support
  • osx 10.8+ supported
  • go 1.8 is last version to support ARMv5E and ARMv6 processors
  • go 1.9 will require ARMv6K 
  • go vet (sort of compiler warnings) now detects closing http.Response.Body before checking error
  • default gopath $HOME/go on unix
  • go bug command opens a bug on github.com/golang/go with version/machine information
  • Compiler backend improvements (SSA) sees cpu usage reductions of 20-30% on arm and upto 10% on x86 (SSA was already part-implemented on x86).

 Performance Improvements


  • build times faster than go 1.7 but slower than go 1.4
  • improved -race detection
  • mutex contention profiling `go test bench=. -mutexprofile=mutex.out`, can provide data on whether you should lock in a less or more granular manner, sequential could even be faster.
  • sub-millisecond (~100 microsecond) GC pause times, costing an extra 1/2% cpu.
  • defer is a 1/10th to a 1/3rd faster, but still not that fast, for example...
  • cgo is 50% faster, mostly due to removing high frequency defer calls

Additions to the Standard Library

  • sort.Slice() introduced, provides easier slice sorting
  • plugins introduced (linux only linux atm), load shared libraries at runtime, enables hot code swapping
  • added Shutdown method to http.Server, was previously very hard to stop previously, personally I had to resort to https://github.com/hydrogen18/stoppableListener
  • HTTP/2 support introduced

Full go 1.8 release notes are here.

go 1.8 is set to be released on February 16th 2017.

Golang UK conference is on August 16th to 18th 2017.


No comments:

Post a Comment