Winfried Plappert <[EMAIL PROTECTED]> added the comment:

The created testfile size is 588890 bytes, which implies that
subprocess.Popen reads the file in completely unbuffered mode, one byte
at a time. If I modify the popentest.py programme by specifying a
bufsize of 1_000_000, the execution time drops quite a bit:
time with os.popen         0.069 sec
time with subprocess.Popen 0.118 sec
This Solaris 9/Python 2.6.

I think I have got it: Lib/subprocess.py should have a default bufsize
of -1, not 0! I tested it by modifying the subprocess.Popen call and
here is the result:
time with os.popen         0.086 sec
time with subprocess.Popen 0.080 sec

See also Modules/posixmodule.c.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4194>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to