Skip to content

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