-
Notifications
You must be signed in to change notification settings - Fork 43
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
Don't copy contiguous bytes on reception #343
Don't copy contiguous bytes on reception #343
Conversation
The aim of this pull request is to fix high latency for relatively large topics (e.g. 1 MB dd82e84
eed223a
eed223a + 401016c
|
a4be550
to
eed223a
Compare
Thanks for opening the PR. We are just in the process of converting to zenoh-cpp as our API in #327. I'm assuming a similar idea will work there, but until we merge that, I'm going to mark this as a draft PR, and we can revisit it once we've merged that in. |
The bytes slice iterator API exists in zenoh-cpp, however there is no |
All right, we've now merged in #327. Please rebase this and make any necessary changes to adapt to zenoh-cpp, and then we can do a full review of it. |
d32f34a
to
bf7c354
Compare
The following are updated benchmark results after switching from the C to the C++ Zenoh API. df6ec26
bf7c354
|
Should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides what I put inline, I'd also prefer not to have the implementation in the header file. That means that any downstream consumer has to compile the code all of the time. My suggestion is to just put this whole thing in the rmw_subscription_data.cpp
file, but if you want to keep it a separate file then I'd suggest keeping just the API in the .hpp file and putting the implementation in a .cpp file.
I will keep a separate translation unit for |
92bdac4
to
662530c
Compare
A little suggestion: The |
This uses the slices iterator API of zenoh-cpp to avoid unecessarily copying bytes into a vecotr, if and only if the bytes is made up of exactly one slice.
Co-authored-by: Chris Lalancette <[email protected]> Signed-off-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Chris Lalancette <[email protected]> Signed-off-by: Mahmoud Mazouz <[email protected]>
0373091
to
e289a48
Compare
79fc5ce seems to have broken the Jazzy build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this now. Thanks for the revisions, I'm going to go ahead and merge this.
This uses the slices iterator API of zenoh-c to avoid unecessarily copying bytes into an owned slice, if and only if the bytes is made up of exactly one slice.