Go 1.20, a planned upgrade to the Google-developed open source language known for its simplicity, concurrency, and functional programming features, has just reached a release candidate stage. The new version previews profile-guided optimization (PGO) for the compiler.
Announced December 7, the Go 1.20 release candidate can be downloaded from go.dev. The production release of Go 1.20 is expected in February 2023.
With Go 1.20, preview support for PGO enables the compiler toolchain to perform application-specific and workload-specific optimizations based on runtime profile data. The compiler currently supports pprof CPU profiles, which can be collected through the runtime/pprof or net/http/pprof packages. Version 1.20 uses PGO to more-aggressively inline functions at hot call sites. Benchmarks for a representative set of Go programs show enabling PGO inlining optimization improves performance about 3% to 4%. More PGO optimizations are planned for future releases.