Skip to content

perf: surface GOGC=400 costs 10-15 MB RSS over long sessions #1310

Description

@santoshkumarradha

Measured in the 2026-09-20 long-session benchmark: the chat surface runs debug.SetGCPercent(400) at cmd/codeaf/main.go:142 (a documented render-latency trade, main.go:55-65). A flat 4-5 MB live heap then carries a ~28 MB heap goal, and RSS grows 10-15 MB over 100 turns that has nothing to do with retained data.

A/B, same 25-turn session: RSS 67.6 MB at GOGC=400 vs 49.2 MB at GOGC=100, live heap identical (gctrace). ~18 MB of RSS from one constant.

Proposal: lower the surface GOGC to 100 or 200, or make it adaptive. Before shipping, rerun the first-paint and scroll perf gate, since the 400 exists to protect render latency.

—
Drafted with CodeAF · reviewed and owned by the author

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chatThe v3 surface a person sits in front of (internal/tui3)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions