Author Aaron.Sherman
Recipients Aaron.Sherman, giampaolo.rodola, gregory.p.smith, neologix, pitrou, vstinner
Date 2011-02-25.22:50:26
SpamBayes Score 4.86703e-06
Marked as misclassified No
Message-id <>
"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...
Date User Action Args
2011-02-25 22:50:29Aaron.Shermansetrecipients: + Aaron.Sherman, gregory.p.smith, pitrou, vstinner, giampaolo.rodola, neologix
2011-02-25 22:50:29Aaron.Shermansetmessageid: <>
2011-02-25 22:50:26Aaron.Shermanlinkissue11314 messages
2011-02-25 22:50:26Aaron.Shermancreate