[Scons-users] Clone effectiveness

Bill Deegan bill at baddogconsulting.com
Tue Sep 18 11:59:36 EDT 2018


Don't forget what Donald Knuth said "*premature optimization is the root of
all evil (or at least most of it) in programming"..*

Is your startup time (null incremental build time) an issue?
If not then don't worry about creating extra clones.

Is it an issue? The run --debug=count and see how many environments you
have. If that number is LARGE then do something to reduce the number of
Clones you're making.

There's no hard and fast rule here.  Anyone saying "Clone() is bad" is more
times than not wrong.
Anyone saying "Clone() a gazillion times and don't worry about it" is more
times than not wrong as well..

I've done some benchmarking on some larger SCons build systems.
The top two null incremental (or when rebuilding a small percentage of
targets due to some small change) build time users are often:
1. Subst() calls
2. Reading and writing sconsign.

Hey.. guess what I've been working on for a while... A Subst rewrite to
hopefully address some performance issues.  Guess what's also on the list..
sconsign rework..

Hope this helps,
Bill

On Tue, Sep 18, 2018 at 3:46 PM Hua Yanghao <huayanghao at gmail.com> wrote:

> Fully agree.
>
> My approach is that I have a keyword parameter from the command line
> to chose which target to build and then only the pattern-matched
> builds are actually created, essentially only one env is created. I do
> it only because I want to avoid the initial startup latency ... if
> your env is not conditionally created or for a built that really have
> many clones then bad luck. Of course it would definitely be great if
> the we cannot feel the existence of scons's runtime.
> On Tue, Sep 18, 2018 at 4:31 PM Pierre-Luc Boily
> <pierreluc.boily at gmail.com> wrote:
> >
> > I agree 15 seconds is not a lot compare to the whole.  But when doing
> > iterative build, 15 seconds it's a lot!  At least we have the
> --interactive
> > as a good work around (on unix).
> >
> > So, beside having longer tree creation with many Clone, could this lead
> to
> > other problems?  Is it better to avoid Clone where I can?
> >
> >
> > Mats Wichmann wrote
> > >>>15 seconds is slow, but if I sped up the sconscript time by 50%, I'd
> > >>>still make no more than a 2% impact on the overall time.
> >
> >
> >
> >
> >
> > --
> > Sent from: http://scons.1086193.n5.nabble.com/Users-f16930.html
> > _______________________________________________
> > Scons-users mailing list
> > Scons-users at scons.org
> > https://pairlist4.pair.net/mailman/listinfo/scons-users
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180918/957f868d/attachment.html>


More information about the Scons-users mailing list