Skip to content

perf(scrollback): reduce multipliers to lower memory baseline#4751

Merged
gregpriday merged 2 commits intodevelopfrom
perf/issue-4743-reduce-scrollback-multipliers
Apr 1, 2026
Merged

perf(scrollback): reduce multipliers to lower memory baseline#4751
gregpriday merged 2 commits intodevelopfrom
perf/issue-4743-reduce-scrollback-multipliers

Conversation

@gregpriday
Copy link
Copy Markdown
Collaborator

Summary

  • Agent terminal multiplier reduced from 2.5x to 1.5x (1500 lines at the default 1000 base)
  • Regular terminal multiplier reduced from 0.5x to 0.3x (300 lines at the default 1000 base)
  • Test assertions updated across 5 files to match the new values

At 160 columns each scrollback line costs ~1.5-2KB. With 12 terminals mostly running agents, the old 2.5x multiplier was adding 50-60MB across processes just in scroll buffers. The new values still exceed VS Code's 1000-line default while being a lot more memory-conscious. Users who need deeper history can bump the base scrollback setting.

Resolves #4743

Changes

  • src/utils/scrollbackConfig.ts — updated multiplier constants
  • src/services/terminal/__tests__/TerminalInstanceService.scrollback.test.ts — updated assertions
  • src/services/terminal/__tests__/TerminalScrollbackController.test.ts — updated assertions
  • e2e/full/core-output-flood.spec.ts — updated expected scrollback values
  • e2e/full/core-terminal-scrollback.spec.ts — updated expected scrollback values

Testing

Unit tests pass against the new multiplier values. E2E scrollback and output flood specs updated to reflect the reduced limits.

- Reduce agent terminal multiplier from 2.5x to 1.5x
- Reduce regular terminal multiplier from 0.5x to 0.3x
- Update unit test assertions and comments to match new values
- Update E2E flood test buffer bound from 600 to 400
- Update missed E2E test core-terminal-scrollback.spec.ts for 0.3x multiplier
- Fix doc comment describing terminal scrollback percentage
@gregpriday gregpriday merged commit 756ac81 into develop Apr 1, 2026
4 checks passed
@gregpriday gregpriday deleted the perf/issue-4743-reduce-scrollback-multipliers branch April 1, 2026 09:32
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.

Reduce scrollback multipliers to lower memory baseline

1 participant