Go 1.21 RC has been released with new features and improved performance
The first Release Candidate (RC) for Go (Programming Language) version 1.21 has been made available today. This new version is packed with new features and improvements, including tool improvements, language changes, standard library additions, and improved performance.
One of the most significant features of Go 1.21 is the Profile Guided Optimization (PGO) feature. According to the release notes, if a file named default.pgo is present in the main package’s directory, the go command will use it to enable a PGO build. This increases performance from 2 to 7%. Moreover, the Go compiler itself has been rebuilt with PGO enabled for 1.21, resulting in building Go programs 2-4% faster, depending on the host architecture.
Additionally, the garbage collector has been tuned, which means that some applications may see up to a 40% reduction in tail latency. This improvement will significantly impact web applications that need to respond quickly to user requests.
Moreover, the go tool now supports backward and forward language compatibility. This means that developers can use a newer version of the Go tool to build programs using an older version of the language and vice versa. This feature will be a significant help to developers who need to maintain and update legacy code.
The Go programming language has become increasingly popular among developers because of its simplicity, concurrency model, and excellent built-in tooling. The release of Go 1.21 is yet another step towards making Go a more efficient and developer-friendly language.