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

Use write_vectored to replace write_all #622

Open
YHM404 opened this issue Jan 30, 2024 · 1 comment
Open

Use write_vectored to replace write_all #622

YHM404 opened this issue Jan 30, 2024 · 1 comment

Comments

@YHM404
Copy link
Contributor

YHM404 commented Jan 30, 2024

Perhaps trying to use write_vectored instead of write_all to reduce memory copying and system call overhead can improve the performance.

@YHM404
Copy link
Contributor Author

YHM404 commented Jan 30, 2024

I will try this approach, but maybe the catch is to modify various interfaces.

Such as:

fn write(bytes: &[u8])

into:

fn write_vectored(bytes: &[u8])

and

fn as_bytes() -> &[u8]

into

fn as_bytes_vec() -> Vec<&[u8]>

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 a pull request may close this issue.

1 participant