Skip to content

tokio-postgres: use tokio mpsc for CopyBoth streams #30

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petrosagg
Copy link

The tokio implementation of mpsc channels seems to be more sophisticated and performant than the one in futures_channel. Since the channels used by the CopyBoth streams transfer a large amount of data during replication this PR switches the implementation to tokio.

This PR doesn't yet alter the size of the channels in order to do an apples to apples comparison. A subsequent test should be performed with larger buffers between the producer and consumer tasks.

The tokio implementation of mpsc channels seems to be more sophisticated
and performant than the one in futures_channel. Since the channels used
by the CopyBoth streams transfer a large amount of data during
replication this PR switches the implementation to tokio.

This PR doesn't yet alter the size of the channels in order to do an
apples to apples comparison. A subsequent test should be performed with
larger buffers between the producer and consumer tasks.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
@petrosagg petrosagg requested a review from antiguru April 9, 2025 13:29
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