Author neologix
Recipients Aaron.Sherman, giampaolo.rodola, gregory.p.smith, neologix, pitrou, vstinner
Date 2011-03-02.13:13:38
SpamBayes Score 1.73438e-06
Marked as misclassified No
Message-id <1299071619.33.0.572439984781.issue11314@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2011-03-02 13:13:39neologixsetrecipients: + neologix, gregory.p.smith, pitrou, vstinner, giampaolo.rodola, Aaron.Sherman
2011-03-02 13:13:39neologixsetmessageid: <1299071619.33.0.572439984781.issue11314@psf.upfronthosting.co.za>
2011-03-02 13:13:38neologixlinkissue11314 messages
2011-03-02 13:13:38neologixcreate