[issue11314] Subprocess suffers 40% process creation overhead penalty

Charles-Francois Natali report at bugs.python.org
Wed Mar 2 14:13:39 CET 2011


Charles-Francois Natali <neologix at free.fr> added the comment:

> So, even though implemented in C, the file descriptor closing logic is still quite costly!

Yes, see this recent issue: http://bugs.python.org/issue11284

In the reporter's case, it's much worse, because FreeBSD (at least the version he's using) has a SC_OPEN_MAX of 655000, so that passing close_fds=True bumps the Popen runtime to 3 seconds!
Some Unix offer a closefrom() or similar function to close all open file descriptors (and only open ones), which should be much faster.
I'm not aware of anything equivalent under Linux, but it might be worth looking into.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11314>
_______________________________________


More information about the Python-bugs-list mailing list