Skip to content

perf: harden memory usage and runtime performance - #87

Merged
vinilana merged 50 commits into
mainfrom
fix/performance-issues
Jul 13, 2026
Merged

vinilana merged 50 commits into
mainfrom
fix/performance-issues

Conversation

@vinilana

Copy link
Copy Markdown
Owner

Summary

This PR consolidates the memory and performance remediation work for dotcontext.

  • bounds subprocess output, diagnostics, and process-tree cleanup
  • sanitizes and caps hook payloads and persistent hook/runtime history
  • streams runtime history with cursor, record-count, and byte budgets
  • hardens LSP lifecycle and protocol framing
  • bounds semantic discovery and cache retention
  • caps MCP input, output, resource, and explore payloads
  • adds performance audit documentation, remediation specs, and preventive skills

Why

Several runtime paths could retain or materialize unbounded data, keep child processes alive, or rescan large repositories. Together these behaviors could cause memory exhaustion and degraded performance in long-running CLI, harness, MCP, and host-integration processes.

The remediation introduces explicit byte/count/retention budgets, bounded streaming, lifecycle cleanup, cache eviction, and regression coverage while preserving the repository's CLI → harness ← MCP/integrations boundaries.

Impact

Large repositories and long-running sessions now degrade through explicit partial results, pagination, rotation, eviction, and bounded diagnostics instead of unbounded allocation. Existing small-input behavior remains compatible.

Validation

  • npm run build
  • npm test -- --runInBand --silent
  • npm run build:packages
  • npm run smoke:packages (5 bundles)
  • focused regression suites for runtime history, hooks, LSP, semantic analysis, replay/datasets, subprocesses, and MCP boundaries

Integration status

PR #80 (shared semantic analysis) has had its conflicts resolved and is mergeable against fix/performance-issues. It is not yet merged into the feature branch; once merged, this PR will update automatically.

@vinilana
vinilana marked this pull request as ready for review July 12, 2026 19:38
@vinilana
vinilana merged commit eefe40e into main Jul 13, 2026
15 of 17 checks passed
@vinilana
vinilana deleted the fix/performance-issues branch July 13, 2026 15:00
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