Socket Performance

Brian Smith brian at briansmith.org
Thu Mar 13 09:33:47 EDT 2008


sleddd at gmail.com wrote:
> Sent: Wednesday, March 12, 2008 9:47 PM
> To: python-list at python.org
> Subject: Socket Performance
> 
> Can anyone explain why socket performance (throughput) varies 
> depending on the amount of data send and recv are called with?
> 
> For example: try creating a local client/server (running on the same
> computer) where the server sends the client a fixed amount of data.
> Using method A, recv(8192) and sendall( ) with 8192 bytes 
> worth of data. Do this 100 times. Using method B, recv(1) and 
> sendall( ) with 1 byte worth of data. Do this 819200 times.
> 
> If you time both methods, method A has much greater 
> throughput than method B.

Why is it faster to drink a liter of water a cupful at a time than to
drink it out of an eyedropper?

- Brian




More information about the Python-list mailing list