Socket performance

MRAB python at mrabarnett.plus.com
Fri Jul 23 21:04:51 EDT 2010


Navkirat Singh wrote:
> Hey Everyone,
> 
> I had a question, programming sockets, what are the things that would 
> degrade performance and what steps could help in a performance boost? I 
> would also appreciate being pointed to some formal documentation or 
> article.
> 
> I am new to this.
> 
Interleaving processing and sending/receiving might reduce throughput
because when you're processing the socket is idle (depending on how much
buffering there is). You could do the socket stuff in another thread so
that it's not waiting for the processing to finish while there is data
available, and use a queue to transfer the data between that thread and
the processing thread.



More information about the Python-list mailing list