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

[Java] Use RingBuffer#tryClaim API to implement zero-copy logging #831

Merged
merged 1 commit into from
Jan 21, 2020

Conversation

vyazelenko
Copy link
Contributor

Replace write/offer into the ring buffer with the tryClaim call which has the following benefits:

  • Zero-copy logging since no intermediate buffers need to be created
  • Zero-overhead logging when buffer is full, i.e. now the space is claimed first before the message is encoded whereas previously the message was encoded but then offer might have failed meaning that work would have been wasted

NOTE: This PR requires agrona-1.3.0 so the build will fail until Agrona is released and integrated into Aeron.

Replace write/offer into the ring buffer with the `tryClaim` call which has the following benefits:
- Zero-copy logging since no intermediate buffers need to be created
- Zero-overhead logging when buffer is full, i.e. now the space is claimed first before message is being encoded whereas before the message was encoded but then offer might have failed meaning that work was wasted
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