This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wplappert
Recipients LambertDW, sameerd, skip.montanaro, wplappert
Date 2008-10-25.13:23:37
SpamBayes Score 1.0945745e-07
Marked as misclassified No
Message-id <1224941020.05.0.449619053922.issue4194@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-10-25 13:23:40wplappertsetrecipients: + wplappert, skip.montanaro, LambertDW, sameerd
2008-10-25 13:23:40wplappertsetmessageid: <1224941020.05.0.449619053922.issue4194@psf.upfronthosting.co.za>
2008-10-25 13:23:38wplappertlinkissue4194 messages
2008-10-25 13:23:37wplappertcreate