Message129450
| Author |
Aaron.Sherman |
| Recipients |
Aaron.Sherman, giampaolo.rodola, gregory.p.smith, neologix, pitrou, vstinner |
| Date |
2011年02月25日.22:50:26 |
| SpamBayes Score |
4.8670304e-06 |
| Marked as misclassified |
No |
| Message-id |
<1298674229.69.0.698157336902.issue11314@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
"That's why I asked for absolute numbers for the overhead difference."
Did you not follow the link in my first post? I got pretty detailed, there.
"os.popen just calls the popen(3) library call, which just performs a fork/execve and some dup/close in between. subprocess.Popen is implemented in Python, so it doesn't come as a surprise that it's slower in your example."
Well, of course. I don't think I was ever trying to claim that os.popen vs. subprocess without a shell was going to compare favorably. I'm not advocating os.popen, here, I'm just trying to figure out where this massive overhead is coming from. I think the answer is just, "pure Python is fundamentally slower, and that's not a surprise."
Now, if the 3.x subprocess work that was described here, gets back-ported into 2.x and is included with future releases, that will definitely serve to improve the situation, and might well render much of this moot (testing will tell).
However, I do think that doing the performance testing before deprecating the previous interface would have been a good idea... |
|