Go 1.19 improves generics and memory model

Go 1.19 improves generics and memory model

Go 1.19 refines the generics support introduced in Go 1.18 and improves the performance of generic code up to 20 per cent.

Credit: Dreamstime

Go 1.19, the latest version of Google's Go (Golang) programming language, has reached production availability. The update improves recently added generics and debuts an enhanced memory model.

With Go 1.19, released August 2, generics development focused on addressing subtle issues and corner cases reported by the community as well as performance improvements (as much as 20 per cent in some generic programs). Long-sought generics capabilities were added to the language with Go 1.18, which was released in March.

The Go memory model, meanwhile, now explicitly defines the behaviour of the sync/atomic package, providing low-level atomic memory primitives for implementing synchronisation algorithms. 

The formal definition of the happens-before relation has been revised to align with memory models used by C, C++, Java, JavaScript, Rust, and Swift. Existing programs are not affected. In addition to the memory model update, there are new types in the sync/atomic package, such as atomic.int64 and atomic.Pointer(T), making it easier to use atomic values.

Go 1.19 can be downloaded from for Windows, macOS, and Linux.

Other features in Go 1.19 include a soft memory limit has been added to the garbage collector. The limit can be helpful for optimising Go programs to run as efficiently as possible in containers with dedicated amounts of memory.

Also, performance and implementation improvements include dynamic sizing of coroutine stacks to reduce stack copyrighting, automatic use of additional file descriptors on most Unix systems, jump tables for large switch statements on x86-64 and ARM64, and support for debugger-injected function calls on ARM64.

Delving deeper, a small correction was made to type parameters in method declarations (existing programs are unaffected) and doc comments now support links, lists, and heading syntax, to help users write clearer doc comments, especially in packages with large APIs.

For security, the os/exec package no longer respects relative paths in PATH look-ups and a new build constraint, unix, is satisfied when the targeted OS is any Unilx-like operating system.

Follow Us

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags Googlesoftware


EDGE 2023

EDGE is the leading technology conference for business leaders in Australia and New Zealand, built on the foundations of collaboration, education and advancement.


ARN has celebrated gender diversity and recognised female excellence across the Australian tech channel since first launching WIICTA in 2012, acknowledging the achievements of a talented group of female front runners who have become influential figures across the local industry.

ARN Innovation Awards 2023

Innovation Awards is the market-leading awards program for celebrating ecosystem innovation and excellence across the technology sector in Australia.

Show Comments