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 Aaron.Sherman
Recipients Aaron.Sherman, gregory.p.smith, pitrou, vstinner
Date 2011-02-25.06:01:48
SpamBayes Score 8.482104e-14
Marked as misclassified No
Message-id <1298613712.05.0.128691321633.issue11314@psf.upfronthosting.co.za>
In-reply-to
Content
"Python 3.2 has a _posixsubprocess: some parts of subprocess are implemented in C. Can you try it?"

I don't have a Python 3 installation handy, but I can see what I can do tomorrow evening to get one set up and try it out.

"disagree with the idea that spawning "exit 0" subprocesses is a performance critical operation ;)"

How else would you performance test process creation overhead? By introducing as little additional overhead as possible, it's possible for me to get fairly close to measuring just the subprocess module's overhead.

If you stop to think about it, though, this is actually a shockingly huge percent increase. In any process creation scenario I'm familiar with, its overhead should be so small that you could bump it up several orders of magnitude and still not compete with executing a shell and asking it to do anything, even just exit.

And yet, here we are. 40%

I understand that most applications won't be running massive numbers of external commands in parallel, and that's the only way this overhead will really matter (at least that I can think of). But in the two scenarios I mentioned (monitoring and Web services such as CGI, neither of which is particularly rare), this is going to make quite a lot of difference, and if you're going to deprecate os.popen, I would think that making sure your proposed replacement was at least nearly as performant would be standard procedure, no?

"I think your analysis is wrong. These mmap() calls are for anonymous memory, most likely they are emitted by the libc's malloc() to get some memory from the kernel. In other words they will be blazingly fast."

The mremap might be a bit of a performance hit, but it's true that these calls should not be substantially slowing execution... then again, they might indicate that there's substantial amounts of work being done for which memory allocation is required, and as such may simply be a symptom of the actual problem.
History
Date User Action Args
2011-02-25 06:01:52Aaron.Shermansetrecipients: + Aaron.Sherman, gregory.p.smith, pitrou, vstinner
2011-02-25 06:01:52Aaron.Shermansetmessageid: <1298613712.05.0.128691321633.issue11314@psf.upfronthosting.co.za>
2011-02-25 06:01:49Aaron.Shermanlinkissue11314 messages
2011-02-25 06:01:48Aaron.Shermancreate