Skip to content

reduce memory copies when consuming kafka responses #83

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

Merged
merged 1 commit into from
Dec 28, 2013

Conversation

eklitzke
Copy link
Contributor

Hi,

This is a simple change that uses the .join() method of strings to join the chunks read from kafka. This reduces memory copies and memory allocations, as the joined string can be allocated all at once, rather than for each chunk. This improvement is especially noticeable when reading large messages.

I've also fixed a typo in the docstring.

@mumrah
Copy link
Collaborator

mumrah commented Dec 28, 2013

@eklitzke looks good to me, I'll go ahead and merge. Would you happen to have any timings comparing the current code with this?

mumrah added a commit that referenced this pull request Dec 28, 2013
reduce memory copies when consuming kafka responses
@mumrah mumrah merged commit bec4dd3 into dpkp:master Dec 28, 2013
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