<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3" -->

---
title: Go 1.26 turned on a new garbage collector. Whether it...
description: Go 1.26 ships with the Green Tea garbage collector enabled by default, promising 10–40% reduction in GC overhead for programs that heavily use the GC. The new...
canonical: https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Go 1.26 turned on a new garbage collector. Whether it helps you depends on how your heap is shaped. | daily.dev
og:description: Go 1.26 ships with the Green Tea garbage collector enabled by default, promising 10–40% reduction in GC overhead for programs that heavily use the GC. The new...
og:url: https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3
og:image: https://api.daily.dev/og/posts/4AGVNC3Q3.png
og:image:alt: Go 1.26 turned on a new garbage collector. Whether it helps you depends on how your heap is shaped.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Go 1.26 turned on a new garbage collector. Whether it helps you depends on how your heap is shaped.

**[Medium](https://daily.dev/sources/medium_js)** · 5 min read · 8 upvotes · 0 comments

## Summary

Go 1.26 ships with the Green Tea garbage collector enabled by default, promising 10–40% reduction in GC overhead for programs that heavily use the GC. The new collector replaces the traditional graph-flood mark algorithm with a span-based approach that processes 8 KiB spans in address order, improving cache locality and enabling AVX-512 vectorized scanning on modern Intel/AMD CPUs. The key insight is that gains depend entirely on heap shape: dense heaps with many same-sized objects at similar graph depths benefit greatly, while pointer-chasing structures like binary trees with low fan-out may see no improvement or even regression. A code sample is provided to benchmark both approaches using the runtime/metrics package. On Go 1.25 Green Tea is opt-in via GOEXPERIMENT=greenteagc; on 1.26 it's default with GOEXPERIMENT=nogreenteagc as an escape hatch until Go 1.27.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@dhawaldyavanpalli/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped-7cfc58924966>

## Questions this post answers

### What is the Green Tea garbage collector in Go 1.26 and how does it differ from the old GC?

Green Tea is Go's new default garbage collector as of Go 1.26, replacing the old graph-flood marker that walked pointers object by object. Instead it tracks 8 KiB spans with two bits per object recording scan/seen status, and scans live objects within a span sequentially in address order, which is far more cache-friendly since roughly 35% of old marking time was spent stalled on cache misses.

_Anyone deciding whether to upgrade Go runtimes can weigh GC tradeoffs like these using coverage on daily.dev._

### How do I test whether Green Tea GC helps my Go 1.25 or 1.26 application before upgrading?

Run the same binary with and without the GOEXPERIMENT flag and compare GC CPU seconds using the runtime/metrics package, reading the /cpu/classes/gc/total:cpu-seconds sample before and after several runtime.GC() cycles. On Go 1.25 use GOEXPERIMENT=greenteagc to opt in; on Go 1.26, where it's default, use GOEXPERIMENT=nogreenteagc to get the old behavior for comparison, since that opt-out disappears in Go 1.27.

_Developers benchmarking runtime upgrades can track Go GC changes like this on daily.dev before rolling them out._

### Why did DoltHub see no performance improvement from Go's Green Tea garbage collector?

DoltHub's SQL engine heap did not benefit because Green Tea's gains depend on spans accumulating enough live objects to amortize bookkeeping overhead, and pointer-chasing structures with low fan-out, such as binary trees where each node touches only one or two others, spread objects thinly across many spans and rarely fill any single one, limiting or eliminating the speedup.

_Teams deciding whether a GC change fits their workload can compare real-world results like this on daily.dev._

## Similar posts on daily.dev

- [Go's New Green Tea Garbage Collector May Improve Performance up to 40%](https://daily.dev/posts/go-s-new-green-tea-garbage-collector-may-improve-performance-up-to-40--8lrm23smt) · InfoQ · 3 upvotes · 0 comments
- [Go 1.26 Quietly Fixed the Things That Were Actually Annoying](https://daily.dev/posts/go-1-26-quietly-fixed-the-things-that-were-actually-annoying-eei6x0bgf) · Towards Dev · 106 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Go 1.26 turned on a new garbage collector. Whether it helps you depends on how your heap is shaped.","url":"https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3"},"datePublished":"2026-07-24T19:36:03.315Z","dateModified":"2026-09-14T08:03:22.440Z","description":"Go 1.26 ships with the Green Tea garbage collector enabled by default, promising 10–40% reduction in GC overhead for programs that heavily use the GC. The new...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f72fbd3e2cf06919cc2b046b2daa7a96?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/f72fbd3e2cf06919cc2b046b2daa7a96?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":8},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,golang","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"Go 1.26 turned on a new garbage collector. Whether it helps you depends on how your heap is shaped."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/go-1-26-turned-on-a-new-garbage-collector-whether-it-helps-you-depends-on-how-your-heap-is-shaped--4agvnc3q3#faq","mainEntity":[{"@type":"Question","name":"What is the Green Tea garbage collector in Go 1.26 and how does it differ from the old GC?","acceptedAnswer":{"@type":"Answer","text":"Green Tea is Go's new default garbage collector as of Go 1.26, replacing the old graph-flood marker that walked pointers object by object. Instead it tracks 8 KiB spans with two bits per object recording scan/seen status, and scans live objects within a span sequentially in address order, which is far more cache-friendly since roughly 35% of old marking time was spent stalled on cache misses. Anyone deciding whether to upgrade Go runtimes can weigh GC tradeoffs like these using coverage on daily.dev."}},{"@type":"Question","name":"How do I test whether Green Tea GC helps my Go 1.25 or 1.26 application before upgrading?","acceptedAnswer":{"@type":"Answer","text":"Run the same binary with and without the GOEXPERIMENT flag and compare GC CPU seconds using the runtime/metrics package, reading the /cpu/classes/gc/total:cpu-seconds sample before and after several runtime.GC() cycles. On Go 1.25 use GOEXPERIMENT=greenteagc to opt in; on Go 1.26, where it's default, use GOEXPERIMENT=nogreenteagc to get the old behavior for comparison, since that opt-out disappears in Go 1.27. Developers benchmarking runtime upgrades can track Go GC changes like this on daily.dev before rolling them out."}},{"@type":"Question","name":"Why did DoltHub see no performance improvement from Go's Green Tea garbage collector?","acceptedAnswer":{"@type":"Answer","text":"DoltHub's SQL engine heap did not benefit because Green Tea's gains depend on spans accumulating enough live objects to amortize bookkeeping overhead, and pointer-chasing structures with low fan-out, such as binary trees where each node touches only one or two others, spread objects thinly across many spans and rarely fill any single one, limiting or eliminating the speedup. Teams deciding whether a GC change fits their workload can compare real-world results like this on daily.dev."}}]}
```

