Go 1.35 Adds Experimental Garbage Collector |
Monday, 18 August 2025 | |||
Go 1.25 has been released with an experimental garbage collector that the team says improves the performance of marking and scanning small objects through better locality and CPU scalability. Since its initial development by Google, Go has matured as an open source project maintained by a team at Google with input from many contributors from the open source community. Go was designed as a systems programming language, and has also been used in high profile commercial successes such as Docker. The new garbage collector is available as an experimental option. The design improves the performance of marking and scanning small objects through better locality and CPU scalability. The developers say that benchmark result vary, but they expect somewhere between a ten and 40% reduction in garbage collection overhead in real-world programs that heavily use the garbage collector. A new Trace flight recorder has also been added. While runtime execution traces have been available for debugging, their size and the cost of continuously writing an execution trace have made developers avoid them for debugging rare events. The new runtime/trace.FlightRecorder API provides a lightweight way to capture a runtime execution trace by continuously recording the trace into an in-memory ring buffer. When a significant event occurs, a program can call FlightRecorder.WriteTo to snapshot the last few seconds of the trace to a file. This approach produces a much smaller trace by enabling applications to capture only the traces that matter. There's also a new, experimental JSON implementation, which can be enabled at build time. One change of note to the language specification is that the notion of core types has been removed in favor of dedicated prose. Core types were introduced in Go 1.18 as an abstract construct that was introduced for expediency and to simplify dealing with generic operands (operands whose types are type parameters). In practice, core types have caused problems, and have now been removed in favor of explicit (and equivalent) prose where needed. The team says this simplifies the Go spec and improves type inference. Go 1.25 is available for download now. More InformationRelated ArticlesGo 1.24 Adds Generic Type Alias Support Insights Into Where Go Is Going A Programmer's Guide To Go Part 2 - Objects And Interfaces A Programmer's Guide To Go Part 3 - Goroutines And Concurrency To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: [email protected] |