feat: introduce zero_copy_from_pipe() and zero_copy_to_pipe() - #352
Open
kaspar030 wants to merge 1 commit into
Open
feat: introduce zero_copy_from_pipe() and zero_copy_to_pipe()#352kaspar030 wants to merge 1 commit into
zero_copy_from_pipe() and zero_copy_to_pipe()#352kaspar030 wants to merge 1 commit into
Conversation
kaspar030
force-pushed
the
zerocopy_direct_pipe
branch
2 times, most recently
from
July 14, 2025 06:53
b55416d to
d25ed46
Compare
Signed-off-by: Kaspar Schleiser <kaspar@schleiser.de>
kaspar030
force-pushed
the
zerocopy_direct_pipe
branch
from
October 14, 2025 07:48
43ac294 to
b15d3c3
Compare
|
@kaspar030 Would you compare In my experience, omitting middler pipe makes slower by unknown reason. |
|
I think monoio' zero_copy() is not extending pipe size to 1 MiB by fcntl call. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#351 brought my monoio version of
yes | netcat -l -p 1234to 80% of the expected performance, but that's not where a high performance Rust library can stop.Looking at the code, I realized that
zero_copy()always creates a newPipe. If either the reader or the writer is already aPipe, this is not necessary.This PR adds two functions for those cases. Together with #351, monoio now matches
yes | netcat ....Without #351, this almost doubles the performance (~160MiB/s -> ~310MiB/s) on my box, but the use case really needs the larger buffer.