[issue4194] Miserable subprocess.Popen performance

Skip Montanaro report at bugs.python.org
Sat Oct 25 15:50:33 CEST 2008


Skip Montanaro <skip at pobox.com> added the comment:

Using a nonzero bufsize parameter makes all the difference in the world:

  Using the default (bufsize=0 ==> unbuffered):

    % python popentest.py
    time with os.popen :  0.035032
    time with subprocess.Popen :  1.496455

  Creating the Popen object with bufsize=8192:

    % python popentest.py
    time with os.popen :  0.034642
    time with subprocess.Popen :  0.041376

  Creating the Popen object with bufsize=1 (==> line buffered):

    % python popentest.py
    time with os.popen :  0.034658
    time with subprocess.Popen :  0.04211

Maybe the default for that parameter shouldn't be zero?

Skip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4194>
_______________________________________


More information about the Python-bugs-list mailing list