This post introduces Green Tea, a new experimental garbage collector in Go 1.25 that significantly reduces GC overhead for many workloads.
- •Enable via GOEXPERIMENT=greenteagc at build time; already production-tested at Google
- •Most workloads see ~10% reduction in GC time; some workloads see up to 40% improvement
- •Planned to become the default GC in Go 1.26 based on current data
- •Go's GC uses a mark-sweep algorithm: mark phase traces object graph from roots (globals/locals), sweep phase frees unvisited objects
- •GC runs concurrently and in parallel with user code; objects are tracked per-page using seen bits for metadata
This summary was automatically generated by AI based on the original article and may not be fully accurate.