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

Use addMultipleTargetTopics instead of looping over multiple calls to addTargetTopic #748

Merged

Conversation

ankon
Copy link
Contributor

@ankon ankon commented Jun 8, 2020

addTargetTopic internally calls addMultipleTargetTopics by building a singular array anyways, and
addMultipleTargetTopics itself is fairly expensive and requires locking: Simply calling
it directly should make things faster when sending out batches for multiple topics.


This should help when batch-producing messages to multiple topics at the same time. Looking at the produce path it seems there could be quite some additional potential for "improvements", but it is difficult to quantify how much all of that would help.

… addTargetTopic

addTargetTopic internally calls addMultipleTargetTopics by building a singular array anyways, and
addMultipleTargetTopics itself is fairly expensive and requires locking: Simply calling
it directly should make things faster when sending out batches for multiple topics.
@Nevon
Copy link
Collaborator

Nevon commented Jun 11, 2020

Nice catch! Could you merge master and we'll get this merged.

Btw, when you create a fork, you can allow maintainers of the forked repo to push to the PR branch, which would allow us to press the nice "update with latest master" button in the PR UI instead of having to bug you.

@ankon
Copy link
Contributor Author

ankon commented Jun 11, 2020

Done.

I'll have a look for that setting, thanks!

@Nevon Nevon merged commit a153f84 into tulios:master Jun 12, 2020
@ankon ankon deleted the pr/producer-add-multiple-target-topics branch June 12, 2020 07:00
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