[Scons-dev] posix_spawn

Jason Kenny dragon512 at live.com
Mon Jun 20 00:40:18 EDT 2016


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:scons-dev-bounces at scons.org] On Behalf Of Daniel Holth
Sent: Sunday, June 19, 2016 9:55 PM
To: SCons developer list <scons-dev at scons.org>
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]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20160619/88707827/attachment.html>


More information about the Scons-dev mailing list