Go 1.14, the latest version of the Google-developed open source programming language used to create Docker, Kubernetes, Istio, and other cloud-native computing projects, is now available as a production release.

The Go upgrade, released February 25, improves the runtime and compiler. Version 1.14 also will be the last to support 32-bit Apple platforms, according to release notes.

With the Go runtime improvements, the performance of most use cases of defer has been boosted to incur nearly no overhead, compared to calling the deferred function directly. As a result, defer now can be used in performance-critical code without overhead concerns.

The improved Go runtime also makes goroutines asynchronously pre-emptible. This means loops without function calls no longer potentially deadlock the scheduler or significantly delay garbage collection. This capability is supported on all platforms except windows/arm, darwin/arm, js/wasm, and plan9/*.

One consequence of the pre-emption implementation is that Go 1.14 programs on Linux and MacOS will receive more signals than earlier versions. Programs using packages such as syscall or golang.org/x/sys/unix will see more slow system calls fail with EINTR errors. These programs will have to handle those errors in some way, most likely by looping to try the system call again.

In addition, the page allocator is more efficient and incurs less lock contention at high values of GOMAXPROCS. This will be most noticeable as lower latency and higher throughput for large allocations done in parallel and at a high rate.

The Go compiler, meanwhile, adds -d=checkptr as a a compile-time option for checking that Go code is abiding by unsafe.Pointer safety rules dynamically. Also, the compiler now can emit machine-readable logs of key optimizations using the -json flag, including inlining and bounds-check elimination. Detailed escape analysis diagnostics now work again, and experimental support is offered for compiler-inserted coverage instrumentation for fuzzing.

Other changes and improvements in Go 1.14 include:

Go 1.14 can be downloaded from golang.org. 

This story, "Go 1.14 focuses on runtime, compiler" was originally published by InfoWorld.

IT World