-
Notifications
You must be signed in to change notification settings - Fork 119
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
High latency on multi-process simple pub/sub with DYNAMIC_REUSABLE
#782
Comments
One of the data-sharing constraints is that the memory policy of the DataWriter should be either This means data-sharing delivery is not used with |
@mauropasse thanks for sharing detailed performance analysis always!
i think this is designed behavior, but constraints. https://fast-dds.docs.eprosima.com/en/latest/fastdds/transport/datasharing.html#constraints btw, did you enable loaned message on subscription during this analysis? (https://docs.ros.org/en/rolling/How-To-Guides/Configure-ZeroCopy-loaned-messages.html#subscriptions) if not, probably that is not true zero copy, there will be a copy from DataReader to ROS 2 subscription. |
Ah, @MiguelCompany sorry, i did not refresh the browser... one step behind, thanks! |
Thanks @MiguelCompany and @fujitatomoya for your answers!
Yes, I run So, since data-sharing delivery is not used with For example, enabling rclcpp intra-process and trying to loan a message results in:
In the other hand, I see the default is |
The only condition to allow borrowing a loaned message is that the type is plain. Data-sharing is not a requirement for borrowing a loaned message. This is done this way since it allows removing the serialization of data, thus reducing one copy for all communication scenarios (network, interprocess, and intra-process).
This is exactly what I think. Setting this requires writing an XML, and the user should know the caveats before changing it from the default. |
On rolling, I'm seeing high latency when using
DYNAMIC_REUSABLE
as history memory policy & zero copy.In the other hand, latency seems OK when using
PREALLOCATED_WITH_REALLOC
.Also latency seems OK when the system is single-process, regardless of the policy (still using loaned msgs).
The system tested uses shared memory to pass a 4MB loaned message between processes:
As reference I'm also showing latency of
IPC OFF
, i.e. not using Loaned messages with shared memory (normal serialized msg).Below I provide a CPU flamegraph (from RPi) for both policies:
Left:
DYNAMIC_REUSABLE
eprosima::fastdds::rtps::UDPChannelResource::perform_listen_operation
.Right:
PREALLOCATED_WITH_REALLOC
The XML config file looks like this for both reader & writer:
Since in this case we're aiming for zero-copy using shared memory with loaned messages, I'm guessing this copy is undesired, i.e. a bug? What do you think?
The text was updated successfully, but these errors were encountered: