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

refacto: disable shared-memory feature by default #182

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

J-Loudet
Copy link

The current implementation is not as optimised as it deserves to be. In short, if the shared memory is enabled, then every time Zenoh-Flow will send data through Zenoh (be it between runtimes on the same host or on different hosts) it will first attempt to send it through shared memory.

As it is now, sending data through shared memory requires a copy as the data does not reside inside a shared memory buffer (it must be copied from the programs memory to the shared memory).

In cases where there is actually a shared memory buffer, this could still lead to better performance. However, as the current design enables it everywhere, if there is no shared memory then the data is copied twice: (i) from the programs memory to the shared memory and (ii) from the shared memory to a Zenoh buffer to be sent on the network.

The current implementation is not as optimised as it deserves to be. In short,
if the shared memory is enabled, then every time Zenoh-Flow will send data
through Zenoh (be it between runtimes on the same host or on different hosts) it
will first attempt to send it through shared memory.

As it is now, sending data through shared memory requires a copy as the data
does not reside inside a shared memory buffer (it must be copied from the
programs memory to the shared memory).

In cases where there is actually a shared memory buffer, this could still lead
to better performance. However, as the current design enables it *everywhere*,
if there is no shared memory then the data is copied twice: (i) from the
programs memory to the shared memory and (ii) from the shared memory to a Zenoh
buffer to be sent on the network.

Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>
@J-Loudet J-Loudet merged commit fd95d28 into main Feb 14, 2024
9 checks passed
@J-Loudet J-Loudet deleted the refacto/shared-memory branch February 14, 2024 11:04
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 this pull request may close these issues.

1 participant