[Scons-dev] SCons-like build system

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Thu Jan 22 03:48:31 EST 2015


Having been poking around in this, I see that 'posix_spawn' cleans to be availble on both aix and solaris (at least they have man pages). Which is a relief for me. However, my current grief is that a 'do nothing' build is still taking 20 minutes to traverse the tree. *part* of this is because I check the md5sum on each file to make sure someone hasn't gone and edit/patched/hacked a generated target (which happens more often than is desirable), but that isn't the bulk of the time taken.

I suspect I could leverage the fact that we use git to get the sha1 of certain repositories that are known not to be changed by us and if we find a file therein, to use the combined sha1 of the repos might improve that at the cost of potentially spurious rebuilds if one of the repos changed but the others didn't as i wouldn't be reading all the files.

From: scons-dev at scons.org At: Jan 21 2015 14:47:48
To: dl9obn at darc.de, scons-dev at scons.org
Subject: Re: [Scons-dev] SCons-like build system

Yes posix_spawn will make a big difference on posix based systems. More so as 
the build get larger and the build system needs more memory. Windows default 
spawn logic is more like posix_spawn so it does not suffer in this case.

The core issue is that a build system spawns lots of processes to do work ( 
compiler, linkers, etc..). the common spawn logic in posix system is to fork, 
which requires the system to setup a copy on write  of the build system memory 
to "child" process. As it turns out this is awful for a build system as the 
child process never touches the "shared" memory from the process, however the 
parent process is busy touching it as it setting states, etc. This requires 
system to copy all the memory we are writing to in the build system.  Given 
that the build system will in general being spawning lot of process. This leads 
to a worse cases memory access pattern on any modern chip architecture, more so 
as the build gets larger and the build system needs more memory. Given the 
posix spawn avoids the cloning the memory, the memory access pattern goes to a 
much better case ( ie  no copy of memory to new page tables, which lead to 
lower tlb misses and then being more likely we are in cache)

Jason


-----Original Message-----
From: Scons-dev [mailto:scons-dev-bounces at scons.org] On Behalf Of Constantine
Sent: Wednesday, January 21, 2015 6:19 AM
To: dl9obn at darc.de; SCons developer list
Subject: Re: [Scons-dev] SCons-like build system

Hello Dirk,

I tested this SCons version with memory optimizations on 10000 C++ files.
Updated graphs can be found here: 
https://github.com/aqualid/aqualid/wiki/Benchmark-results-for-v0.5

I see about 20% improvement.

As I understand using posix_spawn function should improve performance on Linux 
and OSX.

Best regards,
Constantine.

On 01/13/15 21:55, Dirk Bächle wrote:
> As a follow-up of these investigations I have prepared a patch that 
> switches SCons (especially the Node class) to using slots, in order to 
> reduce the overall memory consumption. If you're interested in trying 
> it out with your benchmark, you can get a copy with
>
>   hg clone http://bitbucket.org/dirkbaechle/scons_experimental -r 
> switch_node_to_slots
>
> _______________________________________________
> Scons-dev mailing list
> Scons-dev at scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev

_______________________________________________
Scons-dev mailing list
Scons-dev at scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev
_______________________________________________
Scons-dev mailing list
Scons-dev at scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


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


More information about the Scons-dev mailing list