Python / Socket speed

John Nagle nagle at animats.com
Mon Feb 26 11:36:15 EST 2007


Richard Brodie wrote:
> <msj at infoserv.dk> wrote in message 
> news:1172501644.228475.57540 at a75g2000cwd.googlegroups.com...
> 
>>Seems like sockets are about 6 times faster on OpenSUSE than on
>>Windows XP in Python.
>>
>>http://pyfanatic.blogspot.com/2007/02/socket-performance.html
>>
>>Is this related to Python or the OS?
> 
> 
> It's 6 times faster even when not using Python, so what do you think?
> It's probably 'just' tuning though, the default window sizes are in the
> same ratio. 

     Sockets and pipes are a terrible way to do local interprocess
communication, but it's what we've got.  The problem is that what you
want is a subroutine call, but what the OS gives you is an I/O operation.
If you want to see it done right, take a look at QNX messaging.  QNX
does everything, including I/O and networking, via its interprocess
communication message passing system.  There's the cost of one extra
copy for every I/O operation, but you don't notice it much in practice.
I've run 640x480x15FPSx24bits video through QNX messaging and only used
2% of an 1.5GHZ x86 CPU doing it.

				John Nagle



More information about the Python-list mailing list