Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Slow handling of connection incoming buffer #33

Merged
merged 1 commit into from
Feb 15, 2013
Merged

Slow handling of connection incoming buffer #33

merged 1 commit into from
Feb 15, 2013

Conversation

malor
Copy link
Contributor

@malor malor commented Feb 14, 2013

A connection incoming buffer is extended using += operator. This leads
to unnecessary memory allocations and significant performance drops when
transferring big amounts of data (i. e. a few megabytes). Using of the array('c')
(an array of bytes) data type enables us to handle incoming data efficiently.

I used this dummy code for testing:
worker: http://xsnippet.org/359371/
client: http://xsnippet.org/359372/
binary data: dd if=/dev/urandom of=data.bin bs=512 count=10000

A connection incoming buffer is extended using += operator. This leads
to unnecessary memory allocations and significant performance drops when
transferring big amounts of data (i. e. a few megabytes). Using of the array('c')
(an array of bytes) data type enables us to handle incoming data efficiently.
@eskil
Copy link
Contributor

eskil commented Feb 15, 2013

This looks good. Thanks for the fix!

@klange
Copy link
Contributor

klange commented Feb 15, 2013

Agreed. This looks useful.

klange added a commit that referenced this pull request Feb 15, 2013
Fix slow handling of connection incoming buffer
@klange klange merged commit b568ce7 into Yelp:master Feb 15, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants