Go 1.21 Enabling PGO For Faster Performance, Tuned Garbage Collector

Written by Michael Larabel in Programming on 21 June 2023 at 07:17 PM EDT. 8 Comments
PROGRAMMING
The Go 1.21 release candidate is out today and it's interesting on the performance front plus a few language additions like min / max / clear functions as well as further enhancing its standard library.

Most interesting with the Go 1.21 series is now having its Profile Guided Optimization (PGO) support generally available. The go command will use it to enable a PGO build if there is a default.pgo file present in the main package's directory. Enabling PGO on a wide set of programs has shown to enhance performance by 2~7%. PGO is great when able to collect accurate/realistic traces/profiles of your application's workload and can be very beneficial to performance as shown in numerous compiler implementations.

The Go compiler itself has also been rebuilt with PGO enabled and is showing around 2~4% faster build performance for Go programs. The Go 1.21 release is also showing up to a 40% reduction in tail latency for some applications thanks to tuning the garbage collector.

Go 1.21's go tool also now supports backward and forward language compatibility, min / max / clear functions, improvements to type inference for generic functions, various library additions, and a new experimental port to WebAssembly WASI.

Go logo


More details on the exciting Go 1.21 release candidate today via the project blog on go.dev.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week