Repository navigation
perf(mcp): eliminate SSE buffer churn in streaming parser - #1153
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
henrypark133
approved these changes
Mar 13, 2026
henrypark133
left a comment
Collaborator
There was a problem hiding this comment.
Review: good small perf cleanup
This keeps the SSE parser behavior the same while removing avoidable allocation churn in the hot loop.
Positives:
drain(..remaining_start)is a straightforward replacement for the previous trailing-slice reallocation.- The change is extremely small and easy to reason about.
- Meaningful CI is green.
No blocking issues from my side.
Merged
bkutasi
pushed a commit
to bkutasi/ironclaw
that referenced
this pull request
Mar 28, 2026
drchirag1991
pushed a commit
to drchirag1991/ironclaw
that referenced
this pull request
Apr 8, 2026
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
buffer = buffer[remaining_start..].to_string()) with in-place compaction (buffer.drain(..remaining_start))Why
Issue #1142 identified avoidable allocation churn in
parse_sse_responsefor large/many chunks. Reallocating a newStringeach loop iteration is unnecessary and can degrade throughput.This change keeps the same parser semantics but reuses the existing buffer capacity.
Closes #1142
Validation
cargo fmt --allcargo test -p ironclaw tools::mcp::http_transport::tests::test_http_transport_creation -- --nocapturecargo clippy -p ironclaw --all-targets -- -D warnings