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

*kgo.Record pooling support #827

Closed
wants to merge 2 commits into from

Conversation

ortuman
Copy link

@ortuman ortuman commented Sep 23, 2024

This PR resolves #823 by allowing to reuse consumed records via kgo.(*Record).Reuse method.

Signed-off-by: Miguel Ángel Ortuño <ortuman@gmail.com>
Signed-off-by: Miguel Ángel Ortuño <ortuman@gmail.com>
//
// This option is particularly useful for use cases where the volume of generated records is very high,
// as it can negatively impact performance due to the extra GC overhead.
func EnableRecordsPool() ConsumerOpt {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truth is, I'm not 100% convinced about adding this option. For simplicity, we could always fetch the records directly from the pool, since if the user doesn't explicitly invoke the Reuse method, these will essentially always end up being allocated from the heap.

@twmb twmb added the waiting label Oct 11, 2024
@ortuman ortuman closed this Oct 17, 2024
@ortuman ortuman deleted the ortuman/reduce-kgo-record-alloc branch October 17, 2024 08:32
@vtolstov
Copy link
Contributor

so , i don't understand - records already get from pool or this is not planned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

high number of allocations in kgo.recordToRecord function
3 participants