[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Roundup Robot devnull@devnull added the comment: New changeset 25298224cb25 by Senthil Kumaran in branch 'default': Issue #3709: a flush_headers method to BaseHTTPRequestHandler which manages the http://hg.python.org/cpython/rev/25298224cb25 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Senthil Kumaran sent...@uthcode.com added the comment: Added the flush_headers method and the test function. this issue can be closed now. Thanks, Andrew Schaaf. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Senthil Kumaran orsent...@gmail.com added the comment: Fixed this revision 86640. - Even though this is an internal optimization,I don't think back-porting is a good idea, because it changes the behavior of certain methods like send_header and end_headers - Added the Documentation and other test scenario which was suggested by RDM. 'endian': In the NEWS entry, I have added your handle. If you want me to mention your Real Name, let me know. -- assignee: gregory.p.smith - orsenthil resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
R. David Murray rdmur...@bitdance.com added the comment: Senthil, I didn't clearly express my concern about send_response_only. It doesn't look to me like, with buffering in place, that it *should* write directly, it looks to me like it should write to the buffer. Consider specifically the fact that send_response_only is called from send_response_only, which is in turn called from send_error. So IMO the unit test should at a minimum test that send_response_only buffers, and ideally it should test that send_error buffers (but that would require a somewhat different test harness since it would need to report that its write method was called only once). I think the code you committed is still valid, it just doesn't quite do full header buffering. And I agree that this should not be backported. -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Senthil Kumaran orsent...@gmail.com added the comment: On Sun, Nov 21, 2010 at 03:15:06PM +, R. David Murray wrote: Senthil, I didn't clearly express my concern about send_response_only. It doesn't look to me like, with buffering in place, that it *should* write directly, it looks to me like it should write to the buffer. Correct. Now that I re-looked at the code, keeping your above statement in mind, I tend to agree with you and notice the problem. I think, the headers_buffer should be moved higher up in the class so that it buffer the headers from all these methods which atm write directly to the output stream. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Andrew Schaaf and...@andrewschaaf.com added the comment: This patch (to 86665)... * adds buffering to send_response_only * adds flush_headers and uses it in end_headers and CGIHTTPRequestHandler.run_cgi * tests {send_error,send_response_only,send_header} using a write-counting wfile * improves the docs Also, I've added my name to this account. -- Added file: http://bugs.python.org/file19764/issue3709-from86665.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
endian and...@andrewschaaf.com added the comment: How about this patch? -- keywords: +patch nosy: +endian Added file: http://bugs.python.org/file19689/issue3709.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by Éric Araujo mer...@netwok.org: -- versions: -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
R. David Murray rdmur...@bitdance.com added the comment: It looks good, but as mentioned on IRC it would be nice to have a unit test that confirmed that the headers were being correctly buffered. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
endian and...@andrewschaaf.com added the comment: Working on it... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by endian and...@andrewschaaf.com: Added file: http://bugs.python.org/file19692/issue3709.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
endian and...@andrewschaaf.com added the comment: Ready for review. Added test_header_buffering which fails without the BaseHTTPRequestHandler patch and passes with it. -- Added file: http://bugs.python.org/file19704/issue3709.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by endian and...@andrewschaaf.com: Removed file: http://bugs.python.org/file19689/issue3709.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by endian and...@andrewschaaf.com: Removed file: http://bugs.python.org/file19692/issue3709.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Bruno Gola brunog...@gmail.com added the comment: applied the patch on py3k on trunk and everything seems fine (works here) -- nosy: +brunogola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
R. David Murray rdmur...@bitdance.com added the comment: Thanks for the patch and test. They look good. A doc update is also needed, since the docs are currently written in such a way that buffering the header lines makes the documentation no longer true. Also, send_response_only writes directly to the output stream, it doesn't call send_header. This breaks the buffering. It also means that more test cases are needed, since the added test didn't catch this case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Changes by R. David Murray rdmur...@bitdance.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Terry J. Reedy tjre...@udel.edu added the comment: Does this issue apply to 3.1/2? -- nosy: +tjreedy versions: +Python 2.7 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
Senthil Kumaran orsent...@gmail.com added the comment: Yes, it is applicable to 3.1 and 3.2 as well. This is definitely a good to have performance improvement. -- nosy: +orsenthil versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3709] BaseHTTPRequestHandler innefficient when sending HTTP header
New submission from Yang Zhao [EMAIL PROTECTED]: send_header() in BaseHTTPRequestHandler currently does a write to socket every time send_header() is called. This results in excessive number of TCP packets being regenerated. Ideally, as much of the HTTP packet is buffered as possible, but, at minimum, the header should be sent with a single write as there is a convenient end_header() functional available. Behaviour is observed under python 2.5, but the related code looks identical in SVN trunk. Will contribute patch if request is deemed reasonable but no one is available to work on it; I just need a few days. -- components: Library (Lib) messages: 72051 nosy: yangman severity: normal status: open title: BaseHTTPRequestHandler innefficient when sending HTTP header type: performance versions: Python 2.5 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3709 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com