Skip to content

Commit

Permalink
📝 adjust buf capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Xudong-Huang committed Mar 3, 2024
1 parent d6af6f6 commit 5546621
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/conetty/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub const SERVER_POLL_ENCODE: u8 = 200;
impl RspBuf {
/// crate a new `RspBuf` instance
pub fn new() -> Self {
let mut buf = Vec::with_capacity(64);
let mut buf = Vec::with_capacity(128);
// id + len + ty + len + data
buf.resize(25, 0);
let mut cursor = Cursor::new(buf);
Expand Down
2 changes: 1 addition & 1 deletion src/conetty/stream_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<S: StreamExt> StreamClient<S> {
pub fn new(stream: S) -> Self {
StreamClient {
id: 0,
stream: BufReader::with_capacity(1024, stream),
stream: BufReader::with_capacity(1024 * 32, stream),
}
}
}
Expand Down

0 comments on commit 5546621

Please sign in to comment.