network programming problem??

Sauna erwin_duke at hotmail.com
Fri May 2 12:34:47 EDT 2003


"kkennedy" <titanrebel at comcast.net> wrote in message
news:14bd1399.0304301236.7fe19be5 at posting.google.com...
> 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.

On my windows 2000 I got following numbers:
Run 0 . 0.11
Run 1 . 0.11
Run 2 . 0.11
Run 3 . 0.11
Run 4 . 0.11
Run 5 . 0.13
Run 6 . 0.11
Almost same hardware, I'm behind a broadband router using NAT and DHCP






More information about the Python-list mailing list