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

Added new IConsumer.Consume overload taking target ConsumeResult/Message as param for low-alloc flows. #2369

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

Conversation

UBSaxo
Copy link

@UBSaxo UBSaxo commented Nov 27, 2024

This PR adds a new IConsumer.Consume(int, ConsumeResult) overload that allows caller to bring his own (likely reused) ConsumeResult with embedded Message.

This makes it easy for caller to reuse single ConsumeResult instance and single Message instance and thereby reduce overall allocations.

Headers class has also been optimized internally to only create the backing list when first header is added. This avoids allocating an empty list for all messages without headers.

@UBSaxo UBSaxo requested review from a team as code owners November 27, 2024 13:40
@confluent-cla-assistant
Copy link

confluent-cla-assistant bot commented Nov 27, 2024

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ UBSaxo
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

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