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

reduce memory copying in tpu-client-next #4682

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

alexpyattaev
Copy link

Problem

Tpu-client-next would clone transaction bytes into multiple (5-8) queues to ensure reliable delivery. This created quite a bit of memory copying.

Summary of Changes

  • Change the TransactionBatch implementation to be able to consume any AsRef<[u8]> object and not just Vec
  • Use Bytes objects instead of Vecs to enable cheap copies.

@alexpyattaev alexpyattaev marked this pull request as ready for review January 29, 2025 10:50
Better naming for intermediate variable

Co-authored-by: kirill lykov <[email protected]>
@alexpyattaev alexpyattaev merged commit d27f517 into anza-xyz:master Jan 29, 2025
47 checks passed
@alexpyattaev alexpyattaev deleted the bytes_for_tpu_client branch January 29, 2025 19:48
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