Skip to content

refactor(client): remove unnecessary allocations in SSE parsing#13

Merged
lostmygithubaccount merged 1 commit intomainfrom
cody/optimize-sse-parsing
Apr 5, 2026
Merged

refactor(client): remove unnecessary allocations in SSE parsing#13
lostmygithubaccount merged 1 commit intomainfrom
cody/optimize-sse-parsing

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

  • Replace Vec<&str> collect with peekable() iterator in parse_sse_buffer to avoid heap allocation on the SSE parsing hot path
  • Use early return pattern to eliminate default String::new() allocation for the remaining buffer variable

🤖 Generated with Claude Code

Replace Vec collect with peekable iterator in parse_sse_buffer to avoid
heap allocation on the hot path. Use early return pattern to eliminate
default String::new() allocation for the remaining buffer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount enabled auto-merge (squash) April 5, 2026 22:20
@lostmygithubaccount lostmygithubaccount merged commit 0a484e4 into main Apr 5, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the cody/optimize-sse-parsing branch April 5, 2026 22:22
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