Repository navigation
perf: fix runtime bottlenecks across model, tools, core, and TUI - #281
Merged
Merged
Conversation
Compile JSON schema validators once per tool and share via Arc instead of recompiling on every call. Bound captured command output to 512 KiB and stream file reads through BufReader. Offload file index/search to spawn_blocking. Truncate unified session output at 1 MiB.
Index evidence by operation in a HashMap for tool completion lookups. Cap terminal task retention at 64 and compact terminal queue items on append, so long sessions stop growing allocation history.
Parse skill manifests once per session instead of re-reading on every lookup; refresh_skills invalidates the cache explicitly.
Cache diff computation by revision and stream lines by hash so steady-state frames cost the viewport, not the transcript. Cap and coalesce run output, skip redundant shell redraws, cache progress.json by mtime, and reuse visible file-explorer nodes. Replace quadratic source search with linear KMP matching.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
* perf: harden MCP and connect latency * perf: reduce model streaming overhead * perf(tools): cache validators and bound command output Compile JSON schema validators once per tool and share via Arc instead of recompiling on every call. Bound captured command output to 512 KiB and stream file reads through BufReader. Offload file index/search to spawn_blocking. Truncate unified session output at 1 MiB. * perf(core): index evidence and bound terminal history Index evidence by operation in a HashMap for tool completion lookups. Cap terminal task retention at 64 and compact terminal queue items on append, so long sessions stop growing allocation history. * perf(context): cache skill manifests Parse skill manifests once per session instead of re-reading on every lookup; refresh_skills invalidates the cache explicitly. * perf(tui): cache diff/stream rendering and cap output Cache diff computation by revision and stream lines by hash so steady-state frames cost the viewport, not the transcript. Cap and coalesce run output, skip redundant shell redraws, cache progress.json by mtime, and reuse visible file-explorer nodes. Replace quadratic source search with linear KMP matching.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* perf: harden MCP and connect latency * perf: reduce model streaming overhead * perf(tools): cache validators and bound command output Compile JSON schema validators once per tool and share via Arc instead of recompiling on every call. Bound captured command output to 512 KiB and stream file reads through BufReader. Offload file index/search to spawn_blocking. Truncate unified session output at 1 MiB. * perf(core): index evidence and bound terminal history Index evidence by operation in a HashMap for tool completion lookups. Cap terminal task retention at 64 and compact terminal queue items on append, so long sessions stop growing allocation history. * perf(context): cache skill manifests Parse skill manifests once per session instead of re-reading on every lookup; refresh_skills invalidates the cache explicitly. * perf(tui): cache diff/stream rendering and cap output Cache diff computation by revision and stream lines by hash so steady-state frames cost the viewport, not the transcript. Cap and coalesce run output, skip redundant shell redraws, cache progress.json by mtime, and reuse visible file-explorer nodes. Replace quadratic source search with linear KMP matching.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
* perf: harden MCP and connect latency * perf: reduce model streaming overhead * perf(tools): cache validators and bound command output Compile JSON schema validators once per tool and share via Arc instead of recompiling on every call. Bound captured command output to 512 KiB and stream file reads through BufReader. Offload file index/search to spawn_blocking. Truncate unified session output at 1 MiB. * perf(core): index evidence and bound terminal history Index evidence by operation in a HashMap for tool completion lookups. Cap terminal task retention at 64 and compact terminal queue items on append, so long sessions stop growing allocation history. * perf(context): cache skill manifests Parse skill manifests once per session instead of re-reading on every lookup; refresh_skills invalidates the cache explicitly. * perf(tui): cache diff/stream rendering and cap output Cache diff computation by revision and stream lines by hash so steady-state frames cost the viewport, not the transcript. Cap and coalesce run output, skip redundant shell redraws, cache progress.json by mtime, and reuse visible file-explorer nodes. Replace quadratic source search with linear KMP matching.
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
Reduces per-frame render cost and tool-call overhead across the agent runtime.
Changes
Model streaming (785ece2)
tokio::mpscMCP/connect (fbdce41)
Tools (04616e8)
BufReaderspawn_blocking; truncate unified session output at 1 MiBCore (c566c3a)
Context (a56eb1a)
refresh_skills()invalidates explicitlyTUI (8f3b4bf)
Benchmark (120x40, 150 turns)
Validation
cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,git diff --checkpass