Slow createChild when limit of opened descriptors is set to high value
When system has set a large limit of opened file descriptors, then the function createChild is getting slow, because it tries to close all descriptors up to that limit. On my system it currently takes about 1-2 seconds.
If system has /proc/self/fd or /dev/fd then we can go only though currently opened descriptors and close them. Otherwise we can fallback to the current solution, that tries to call close on all possible descriptors.
Ah yes, Python 3 has a similar code in subprocess. My http://www.python.org/dev/peps/pep-0446/ might allow to avoid completely closing all FDs, but I didn't try.
I don't maintain this project anymore, I'm looking for a new maintainer.