network programming problem??

kkennedy titanrebel at comcast.net
Wed Apr 30 16:36:01 EDT 2003


I have written a small script to retrieve the python.org web page 7
times. I did this to try and provide data for a percieved problem in
another Python program. I ran this script on Windows XP and SuSE Linux
8.2 both running on the same machine (Athlon XP 2000+, 512MB RAM,
D-Link DFE-530TX+ NIC).  Here is the script:
-------------------- START -------------------------
from urllib import urlopen
import time

for x in range(7):
    start = time.time()
    doc = urlopen("http://www.python.org").read()
    end = time.time()
    print "Run %d . %0.2f" % (x, end - start)
--------------------- END --------------------------

Here are the results of running the script:

-------------------- LINUX --------------------------
Run 0 . 16.69
Run 1 . 16.54
Run 2 . 17.04
Run 3 . 16.55
Run 4 . 16.55
Run 5 . 16.54
Run 6 . 16.55

-------------------- WIN XP -------------------------
Run 0 . 2.69
Run 1 . 0.59
Run 2 . 0.61
Run 3 . 0.66
Run 4 . 0.59
Run 5 . 0.61
Run 6 . 0.59


Does anyone have a clue why these results are soooo different.  The
SuSE system doesn't "feel" sluggish.  My first clue was that a Linux
user complained about my program being slow, but none of my Windows
users complained.  My second clue was that I thought I could tell a
pretty big difference while browsing the web on Win XP vs. SuSE.  I
just thought it was my imagination, but I guess not!  This is quite a
difference.

I was under the impression that the TCP/IP stack on Linux was second
to none. Could it be that my NIC has poor driver support?  Any
suggestions would be welcome.

Thanks.

P.S. I have continued to get almost exactly the same results every
time I run the script on each OS, so I absolutely do not believe that
internet traffic is making any difference.




More information about the Python-list mailing list