perf: eliminate loop string allocations and proxy mem spikes

This commit is contained in:
Riz Ashraf committed 2026-09-21 09:40:37 +01:00
1 parent d5a05f8416
commit dc59aa9238
5 files changed
+30 -24

No files matched your search

+2 -1
View File
@@ -6,8 +6,9 @@ pub async fn read_mcp_message<R: tokio::io::AsyncRead + Unpin>(
stdin: &mut BufReader<R>,
) -> Option<String> {
let mut length = 0;
let mut line = String::new();
loop {
let mut line = String::new();
line.clear();
if stdin.read_line(&mut line).await.unwrap_or(0) == 0 {
return None;
}