Re: posix_spawn

Jason Kenny <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <[email protected]>
Why is subprocess to slow?

 

We have a monkey patch for this Parts ( I am unsure it was added correctly in to SCons yet.. think there was a desire to control the uses of posix spawn better) Here is a link:

https://bitbucket.org/sconsparts/parts/src/3a389f774f234694994071d784af88c3babaad03/parts/overrides/stubprocess.py?at=master <https://bitbucket.org/sconsparts/parts/src/3a389f774f234694994071d784af88c3babaad03/parts/overrides/stubprocess.py?at=master&fileviewer=file-view-default> &fileviewer=file-view-default 

 

We found the posix_spawn was the better default, as cloning the process space for a build system ( as well as testing systems) was a speed issue. 

 

 

Jason

 

From: Scons-dev [mailto:[email protected]] On Behalf Of Daniel Holth
Sent: Sunday, June 19, 2016 9:55 PM
To: SCons developer list <[email protected]>
Subject: [Scons-dev] posix_spawn

 

I found this lovely cffi implementation of posix_spawn https://github.com/projectcalico/python-posix-spawn . Since subprocess.Popen() is too slow on PyPy, this gives a welcome speedup, but it would probably help on CPython as well. However the file redirection is probably not correct.

in posix.py:

def exec_subprocess_spawnp(l, env):

    pid = posix_spawn.posix_spawnp(l[0], l, env)

    return os.waitpid(pid, 0)[1]

_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.