[Pythonmac-SIG] httplib slow on MacOSX 10.2.3?

Dave White dave@spacehotel.com
Tue, 31 Dec 2002 17:22:26 -0800


Hello,
I was moving over some python apps from linux to my new 1ghz powerbook 
and was running a few to see how fast they run.  Normal calculations and 
threads ran fast, a little faster than linux (intel) mhz for mhz. 
 However a load testing app I have that uses httplib runs incredibly 
slow, about 1/100th the speed when the app runs on a similarly 
configured linux machine.  

I've narrowed it down to the calls to httplib, tested this on 2 macs 
running Jaguar with very similar results.  Here's the code I use, 
basically calling this repeatedly via multiple threads to simulate a 
heavy load on a web server:

	conn = httplib.HTTPConnection("www.python.org")
	conn.request("GET", "/index.html")
	r1 = conn.getresponse()
	conn.close()

I tried replacing the code above with pow(999,999) to test just the threads and mac os x is really fast, it really seems that something is funky with mac os x and httplib.

Has anyone experienced this?   I'm using the stock python 2.2 that ships 
with jaguar.

cheers,
Dave White