docs: CLI CPU/memory usage audit — March 24-31, 2025#8027
Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Open
docs: CLI CPU/memory usage audit — March 24-31, 2025#8027kilo-code-bot[bot] wants to merge 1 commit intomainfrom
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
Conversation
Investigate recent changes merged to main that could affect CLI runtime performance. Identifies 5 findings (1 high, 1 medium, 3 low) and 3 positive mitigations. Key finding: Ripgrep.tree() re-enabled in system prompt runs on every agent loop step without caching, spawning a child process each time. Also flags the unmerged codebase-indexing branch as a future concern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Investigation of changes merged to
mainin the last 7 days (March 24-31, 2025) that could increase CPU or memory usage in the Kilo CLI runtime.Findings
HIGH severity
03691ebe4, fix(cli): restore directory tree in system prompt #7949): Spawnsrg --fileson every agent loop step without caching. For a 50K-file project with 10 tool calls per turn, this is ~10 child process spawns doing full filesystem walks that produce identical results. Recommendation: cache per agent turn.MEDIUM severity
23c7d053f, KiloSessions - Add WebSocket activity watchdog with heartbeat ack #7941): Adds a newsetIntervaltimer (fires every ~5s) per remote connection. Properly cleaned up, but adds background CPU wake-ups.LOW severity
2cdf6b61c, perf(cli): cache MCP listTools results to avoid redundant RPCs per loop step #7922): Net positive — eliminates 300-750ms overhead per step. Adds a small bounded Map.80f187ebb, feat(kilo-vscode): migrate legacy sessions into new extension #7924): On-demand only during migration. No ongoing impact.0578a23e9, feat: add Apertis to provider migration mapping #7205): Fires model fetch even without API key configured.Positive mitigations merged
summary.diffsfrom TUI store (multi-MB savings)Not yet merged (future concern)
codebase-indexing): ~23K lines adding file watcher, vector store, tree-sitter parsing, background scanning. Will be the largest CPU/memory impact when merged.See
CPU_MEMORY_AUDIT_MARCH_2025.mdfor full details with commit references and code locations.