Google Go 1.9 scales, performs and compiles better
19 June 2017 | 0
The next version of Google’s popular Go language will improve performance, compilation, and scaling to large code bases. Go 1.9 should be released in August.
Go 1.9’s creators expect almost all Go programs to run as they did before, given the focus on maintaining compatibility in this latest release.
Here is what is new and improved:
- Speed-ups in the garbage collector, better-generated code, and core library optimisations should make programs run a bit faster.
- The maths/bits package offers optimised implementations to manipulate bits. Functions in this package are treated by the compiler as intrinsics to boost performance.
- The Go 1.9 compiler supports parallel compilation of functions in a package, leveraging multiple processor cores. Go 1.9 retains the previous versions’ go command’s support for parallel compilation of separate packages. Parallel compilation is on by default but can be disabled.
- For scalability, Go 1.9 adds support for type-alias declaration for code repair. A change to the Go language, type aliases support gradual code repair while moving a type between packages. It should aid code repair during large-scale refactoring, moving a type from a package in a way that code referring to an old name interoperates with code referring to the new name. Essentially, the introduction of type aliases provides a transition period in which the API is available from both new and old packages, making references to old and new versions interoperable.
- Go 1.9 adds transparent monotonic time support, which makes computing durations between two Time values a safe operation in the presence of wall-clock adjustments.
- Go 1.9 improves test helper capabilities, with new methods to mark the calling function as a test helper function.
- A new type in the sync package serves as a concurrent map with amortised-constant-time loads, stores, and deletes. Thus, multiple go routines can call a map’s methods concurrently.
IDG News Service