Skip to content

feat(server): implement zero-copy message handling #1679

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

hubcio
Copy link
Contributor

@hubcio hubcio commented Apr 6, 2025

This commit introduces significant refactoring across the SDK and server to enable zero-copy operations for message polling and sending within the append-only log streaming framework.

The primary goal is to improve performance by reducing memory allocations and copies, especially for message payloads, leading to lower latency and higher throughput.

Changes:

  • Refactored Message Structures: introduced IggyMessage and IggyMessagesBatchMut / IggyMessagesBatchSet to handle message data with minimal copying, which replaced previous PolledMessages and Message structures in many contexts
  • Serialization/Deserialization: Updated the BytesSerializable trait and implementations to support more efficient serialization and direct buffer manipulation, avoiding intermediate copies where possible
  • Command Handling: Modified PollMessages, SendMessages, and corresponding server-side handlers (poll_messages_handler, send_messages_handler) to work with the new zero-copy structures and mechanisms
  • Client/SDK: Updated MessageClient trait, IggyClient, IggyConsumer, and CLI commands (poll-messages, send-messages) to align with the new message handling logic

@hubcio hubcio force-pushed the zero-copy-no-batching-rebase-3 branch 6 times, most recently from 4a5fe65 to c3bc623 Compare April 6, 2025 18:43
@numinnex numinnex requested a review from Copilot April 6, 2025 20:15
Copilot

This comment was marked as abuse.

@hubcio hubcio force-pushed the zero-copy-no-batching-rebase-3 branch 4 times, most recently from 19d4448 to ee8bf6f Compare April 11, 2025 15:41
This commit introduces significant refactoring across the SDK
and server to enable zero-copy operations for message polling
and sending within the append-only log streaming framework.

The primary goal is to improve performance by reducing memory
allocations and copies, especially for message payloads, leading
to lower latency and higher throughput.
Changes:
- Refactored Message Structures: introduced `IggyMessage` and
  `IggyMessagesBatchMut` / `IggyMessagesBatchSet` to handle
  message data with minimal copying, which replaced previous
  `PolledMessages` and `Message` structures in many contexts
- Serialization/Deserialization: Updated the `BytesSerializable`
  trait and implementations to support more efficient serialization
  and direct buffer manipulation, avoiding intermediate copies
  where possible
- Command Handling: Modified `PollMessages`, `SendMessages`, and
  corresponding server-side handlers (`poll_messages_handler`,
  `send_messages_handler`) to work with the new zero-copy structures
  and mechanisms
- Client/SDK: Updated `MessageClient` trait, `IggyClient`,
  `IggyConsumer`, and CLI commands (`poll-messages`, `send-messages`)
  to align with the new message handling logic

This is BREAKING_CHANGE.
@hubcio hubcio force-pushed the zero-copy-no-batching-rebase-3 branch from ee8bf6f to c58ef05 Compare April 11, 2025 15:45
@hubcio hubcio force-pushed the zero-copy-no-batching-rebase-3 branch 2 times, most recently from 9f60ac9 to 5cf4d75 Compare April 14, 2025 23:26
@hubcio hubcio force-pushed the zero-copy-no-batching-rebase-3 branch from 5cf4d75 to 34e3a91 Compare April 15, 2025 00:19
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.

3 participants