Skip to content

perf: increase buffer sizes and nil out references on tab close#136

Merged
andyrewlee merged 1 commit intomainfrom
improve-performance
Feb 1, 2026
Merged

perf: increase buffer sizes and nil out references on tab close#136
andyrewlee merged 1 commit intomainfrom
improve-performance

Conversation

@andyrewlee
Copy link
Copy Markdown
Owner

@andyrewlee andyrewlee commented Feb 1, 2026

  • Increase message buffer sizes to reduce drops under load:

    • externalMsgs: 1024 → 4096
    • externalCritical: 256 → 512
    • tabEvents: 1024 → 4096
    • ptyReadQueueSize: 32 → 64
    • monitorSnapCh: 2 → 8
  • Nil out large references on tab close to help GC:

    • Terminal, cachedSnap, DiffViewer, Workspace, pendingOutput
    • Note: Agent is intentionally NOT niled to avoid racing with tab_actor

These changes reduce message drops and memory pressure when running 10+ agents.

Amp-Thread-ID: https://ampcode.com/threads/T-019c17da-ebfb-725c-a07c-fcfdd35f03f9


Open with Devin

- Increase message buffer sizes to reduce drops under load:
  - externalMsgs: 1024 → 4096
  - externalCritical: 256 → 512
  - tabEvents: 1024 → 4096
  - ptyReadQueueSize: 32 → 64
  - monitorSnapCh: 2 → 8

- Nil out large references on tab close to help GC:
  - Terminal, cachedSnap, DiffViewer, Workspace, pendingOutput
  - Note: Agent is intentionally NOT niled to avoid racing with tab_actor

These changes reduce message drops and memory pressure when running 10+ agents.

Amp-Thread-ID: https://ampcode.com/threads/T-019c17da-ebfb-725c-a07c-fcfdd35f03f9
Co-authored-by: Amp <amp@ampcode.com>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional flags.

Open in Devin Review

@andyrewlee andyrewlee merged commit 5f059bc into main Feb 1, 2026
1 check passed
@andyrewlee andyrewlee deleted the improve-performance branch February 1, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant