Message75208
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. |
|
Date |
User |
Action |
Args |
2008-10-25 13:23:40 | wplappert | set | recipients:
+ wplappert, skip.montanaro, LambertDW, sameerd |
2008-10-25 13:23:40 | wplappert | set | messageid: <1224941020.05.0.449619053922.issue4194@psf.upfronthosting.co.za> |
2008-10-25 13:23:38 | wplappert | link | issue4194 messages |
2008-10-25 13:23:37 | wplappert | create | |
|