Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql-srv: Optimize buffer use reading from the client socket #1254

Open
jasobrown-rs opened this issue May 7, 2024 · 0 comments
Open

mysql-srv: Optimize buffer use reading from the client socket #1254

jasobrown-rs opened this issue May 7, 2024 · 0 comments

Comments

@jasobrown-rs
Copy link
Contributor

Description

When looking at a flamegraph produced while running a system-benchmark, I discovered that we spend a lot of time in PacketReader::next() just resizing the backing Vec<u8>. There's more efficient ways to handle the buffer here. Naively, we should look at the bytes crate as it integrates with tokio natively.

This code in PacketReader is fairly self-contained so any optimization should be rather straight forward.

Change in user-visible behavior

N/A

Requires documentation change

N/A

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

No branches or pull requests

1 participant