chiark / gitweb /
Work around performance bug in subprocess.Popen.communicate()
In Python 2.4 (specifically, I tested with 2.4.6 on Ubuntu 9.04),
subprocess.Popen.communicate() seems to take time proportional to the
square of the size of the indata, which makes it ridiculously
expensive to write stack log entries when the diffs are large. Work
around the bug by calling subprocess.Popen.stdin.write() manually
instead of letting communicate() handle the indata.
The performance bug has been fixed in Python 2.6 (I tested with
2.6.2), so with that version this workaround doesn't affect the run
time. I haven't tested with Python 2.5.
This fixes bug 13319.
Signed-off-by: Karl Wiberg <kha@treskal.com>