I did some measurements, with the script below.
For 30 requests, a single HTTP 1.1 connection
needs 5.4s over my DSL connection; 30 individual
connections need 11.7s. So if setuptools expects
to request multiple pages from the index, it would
definitely be useful to keep the connection
(I don't know at all whether it currently does so
already).

Regards,
Martin

import httplib, time

t=time.time()
h = httplib.HTTPConnection("cheeseshop.python.org")
for i in range(30):
    h.putrequest("GET", "/pypi/Lamina/")
    h.endheaders()
    r = h.getresponse()
    r.begin()
    r.read()
h.close()
print time.time()-t

t=time.time()
for i in range(30):
    h = httplib.HTTPConnection("cheeseshop.python.org")
    h.putrequest("GET", "/pypi/Lamina/")
    h.endheaders()
    r = h.getresponse()
    r.begin()
    r.read()
    h.close()
print time.time()-t
_______________________________________________
Catalog-SIG mailing list
[email protected]
http://mail.python.org/mailman/listinfo/catalog-sig

Reply via email to