Google has released Go 1.23, the latest version of its popular open source language for systems programming. The update reduces build time when using profile-guided optimization (PGO) and improves performance with PGO on 386 and amd64 architectures, the company said.

Published August 13, six months after Go 1.22, Go 1.23 can be downloaded for multiple platforms including Linux, macOS, and Windows, from go.dev.

Prior to Go 1.23, large builds could see a 100%-plus build time increase from enabling PGO. In Go 1.23, overhead should be in single-digit percentages, Google said. For 386 and amd64 architectures, the compiler will use certain information from PGO to align certain hot blocks in loops to improve performance.the compiler also reduces stack usage for applications. In Go 1.23, build time overhead to building with profile-guided optimization has been significantly reduced. The compiler in Go 1.23 also reduces stack usage for Go applications, accomplishing this by overlapping the stack frame slots of local variables in disjoint regions of a function, according to release notes.

In a language change, the “range-over-func” experiment from Go 1.22 becomes part of the language in Go 1.23. The “range” clause in a “for-range” loop now accepts iterator functions of several types as range expressions. Go 1.23 also previews support for generic type aliases.

In tool improvements, the toolchain in Go 1.23 can collect data usage and breakup statistics to help the Go team understand how the toolchain is used and how well it is working. This is referred to as Go Telemetry.

Elsewhere in Go 1.23:

  • Experimental support is added for OpenBSD on the 64-bit RISC-V architecture.
  • For the standard library, the implementations of time.Timer and time.Tickerhave changed. Timers and Tickers that are no longer referred to by the program become immediately eligible for garbage collection, even if their Stop methods have not been called. And the timer channel associated with a Timer or Ticker is now unbuffered, with capacity 0.
  • Also for the standard library, a new unique package offers facilities for canonizing values such as “interning.” And a new iter package provides basic functions for working with user-defined iterators. The slices package adds several functions that work with iterators.
  • The trace tool now better tolerates partially broken traces by attempting to recover whatever trace data it can. This is considered particularly helpful when viewing a trace collected during a program crash.
  • For the runtime, the traceback printed after an unhandled panic or other fatal error now indents the second and subsequent lines of the error by a single tab, so it can be unambiguously distinguished from the stack trace of the first goroutine.
  • For the go command, a new go env-changed flag causes the command to print only those settings whose effective value differs from the default value that would be obtained in an empty environment with no prior uses of the -w flag.
  • The linker now disallows using a //go:linkname directive to refer to internal symbols in the standard library not marked with //go:linkname on their definitions. The linker also disallows references to these symbols from assembly code.