Two Pythons talking to each other?

Roy Smith roy at popmail.med.nyu.edu
Thu Jul 8 13:40:41 EDT 1999


petravick at fnal.gov wrote:
> AF_UNIX is likely to me more effcient if that matters.
> 
> AF_INET will run about the whole protocol stack, AF_UNIX
> is usually implemented to be more like a pipe...

Almost certainly such a small difference it couldn't possibly matter.

I just tried an experiment.  I copied a 53 Mbyte file from one directory
to another on my Digital Unix alpha.  I did it twice, once using "cp", the
other time using "ftp" connected to localhost.  The results:

cp:  0.015 sec user CPU time, 4.088 sec system CPU time
ftp: 0.084 sec user CPU time, 3.300 sec system CPU time

Of course, I'm only showing the client side CPU time.  It's reasonable to
expect that the server side CPU time was similar, so at first blush, I'd
guess the ftp really took a total of about 3.6 second, or about 1.5x the
CPU time of the "cp" command.

But, in both cases, real time was 10x the CPU time, indicating that I/O
speed totally swamped everything else.

I don't know what the python job in question was supposed to be doing, but
it's almost inconvievable that anything you do in python to the data won't
totally swamp the CPU time spent doing the TCP/IP protocol processing in
the kernel.

-- 
Roy Smith <roy at popmail.med.nyu.edu>
New York University School of Medicine





More information about the Python-list mailing list