Message76406
I have addressed some issues mentioned:
1) I have retained the _send_output() method.
2) the endheaders() method now takes an optional argument, send_data
that defaults to True. It also returns any unsent data as a string.
This simplifies any code wishing to send more data.
3) The old HTTP class needs no changes anymore.
4) I've fixed the test_xmlrpc.py test case to run all the tests on
windows. The old concern with "WSAEWOULDBLOCK" seems to be no longer
valid.
5) concatenating the result from endheaders() with the request body is
valid, in xmlrpclib, because the assumption has already been made in
send_content() that request_body is a string (str(len(request_body)).
However, in httplib's request() method, we now special case this. I
don't want to complicate the code for what appears to be a rare case.
I chose not to mess with xmlrpclib and make it continue to use the old
HTTP class in order to minimise the extent of this patch. A simple and
clear performance patch has in my experience a much greater chance of
finding its way into the codebase than a more extensive rewrite :)
You may have concerns regarding point 3 above, and I am open to
suggestions.
Now, what remains is the question of the read buffering for the socket
fileobject. Do you think that it is feasible to simply change the
default read buffering for fileobjects to use buffering for readline()
same as they do for read()? Then we wouldn't need the second half of
this patch and we could make a separate "socket" performance patch. |
|
Date |
User |
Action |
Args |
2008-11-25 11:13:40 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, jhylton, vstinner |
2008-11-25 11:13:40 | kristjan.jonsson | set | messageid: <1227611620.52.0.772028483822.issue4336@psf.upfronthosting.co.za> |
2008-11-25 11:13:39 | kristjan.jonsson | link | issue4336 messages |
2008-11-25 11:13:38 | kristjan.jonsson | create | |
|