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

Send small messages directly without shared memory #193

Merged
merged 1 commit into from
Mar 7, 2023
Merged

Conversation

phil-opp
Copy link
Collaborator

@phil-opp phil-opp commented Mar 7, 2023

We currently need an additional request to prepare zero-copy shared memory messages. For small messages, it might be faster to avoid this extra round-trip and send the message directly over TCP. This PR implements support for this. Messages smaller than a threshold (currently set to 4096 bytes) are sent via TCP, while larger messages still use shared memory.

This step also enables future optimizations such as queueing output messages in order to improve the throughput.

We currently need an additional request to prepare zero-copy shared memory messages. For small messages, it might be faster to avoid this extra round-trip and send the message directly over TCP. This commit implements support for this. Messages smaller than a threshold (currently set to 4096 bytes) are sent via TCP, while larger messages still use shared memory.

This step also enables future optimizations such as queueing output messages in order to improve the throughput.
apis/rust/node/src/lib.rs Show resolved Hide resolved
@haixuanTao
Copy link
Collaborator

haixuanTao commented Mar 7, 2023

Looks good and does improve performance on low data size message. 👍

@phil-opp phil-opp merged commit df4d8c5 into main Mar 7, 2023
@phil-opp phil-opp deleted the copy-messages branch March 7, 2023 15:49
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.

2 participants