[Scons-dev] SCons-like build system

Dirk Bächle tshortik at gmx.de
Sun Feb 1 17:19:52 EST 2015


Constantine,

On 01.02.2015 22:25, Constantine wrote:
> Good results, Dirk.
>
> It's definitely worth to use posix_spawn.
> When do you plan to integrate the experimental version into the mainline?
>

next step is switching the Node class to using __slots__, then we want to do a full release 2.4. After that, the version 2.5 will 
contain the stubprocess/posix_spawn wrapper...if all goes well.

> /> .. including some hacks to exploit the uniform structure of the benchmark sources//../
> What kind of hacks?
> How do they affect performance?
>

I pre-expanded the CXXCOM action string like this:

   DefaultEnvironment(tools=[])
   env = Environment(tools=['g++','ar','link','fastcpp'],
                     CPPFLAGS=['-Wall'], CPPDEFINES=['LINUX'], CPPPATH=[Dir('#')])
   env['CXXCOM'] = 'g++ -o $TARGET -c -Wall -I. -DLINUX $SOURCES'

because it stays the same all the time. This shortcuts a lot of subst()ing of strings. As you can see, I also used the "fastcpp" 
Tool which additionally replaces the default suffixes for CPP/object files with their actual strings.
For some classes like Action, I found several places where a lot of checking is done, in order to provide maximum flexibility. It's 
normally allowed to pass a sequence of mixed strings and Nodes as "target" or "source" parameter. Here, I assume that it's always a 
list of strings...so the check is commented out. For the full changes see the attached patch, they cut the complete reading/parsing 
of all SConscripts down to 30 seconds.

This is only to show that the basic design of SCons is able to provide fast results, when turning the right knobs...and also to 
identify the places where most of the runtime is spent. Whether to actually include some of my hacks, and in which form 
(command-line option?, Tool?) would still have to be discussed.

>
> Thank you for testing the clean targets case.
> I haven't tested this case on large projects.

You should definitely have a look at this. It seems to get worse when the number of total files for the build increases. By the way, 
do you support custom commands and generated files in Aqualid? Like, let's say:

  - "foo.c" is compiled to the "foo" executable
  - "foo" is then used to create the header "bar.h"
  - "bar.h" is an implicit dependency of "bar.c"
  - "bar.c" is compiled to "bar"

It would also be interesting to see how well Aqualid is doing in the build system shootout:

   https://github.com/ndmitchell/build-shootout

by Neil Mitchell. Have a look at it, if you find the time.

Best regards,

Dirk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scons_speedup.patch
Type: text/x-patch
Size: 7427 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20150201/fbb24d64/attachment.bin>


More information about the Scons-dev mailing list