Work around performance bug in subprocess.Popen.communicate()
commit465e13d3e3d2d83c0857d9f4613cbdcb5ec37566
authorKarl Wiberg <kha@treskal.com>
Thu, 13 Aug 2009 22:19:24 +0000 (13 23:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 13 Aug 2009 22:19:24 +0000 (13 23:19 +0100)
treed69f09cd542f1251bf2da0277f587ceb5734499f
parent9a4a9c2c9c5dad509c68716ac8ec043b5604fa91
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>
stgit/run.py