Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-10-15 04:57:11


Hi Pedro,

> > > Note that, for 1000 files, find-project-root is called 3008 times and
> > > returing a fixed string reduced the gross time from 22056 ms to 10 ms.
> >
> > Ehm... I think that's good to see the reduction, though it's probably not
>
> good
>
> > to call this rule that many times.
>
> Right. I was just trying to figure out that.

It turns out that find-project-root is called from project.find and that's
rule is called for virtually every target, for example to determine what
"a.cpp" means. The call to find-project-root was added to support the
"project-root.jam as Jamfile" feature I was complaining about...

> BTW, is there a way to print out a stack trace in a Jam rule?

Yes, take a look at "backtrace" rule in the "errors" module.

> > Could you send me your script so that I
> > can figure out the origin of that number of calls? And, maybe, the script
> > should go to CVS....
>
> It is attached.
>
> The Jamfile it generates is a bit complex for this purpose: it is based on
> a Jamfile generator I wrote for our projects and I use it so I can better
> simulate what happens with our own projects. Anyway, I have tried it
> without all the 'overhead' and it really doesn't affect performance.

Thanks. The output for my system is

# files 1 Elapsed: 0.220
# files 5 Elapsed: 0.261
# files 10 Elapsed: 0.329
# files 50 Elapsed: 0.772
# files 100 Elapsed: 1.383
# files 200 Elapsed: 2.745
# files 300 Elapsed: 4.292
# files 500 Elapsed: 8.104
# files 1000 Elapsed: 20.726

(after I increase the limit on command line length --- otherwise it can't link
with gcc with 300 targets).

I'm now going to apply your patch and see how it goes.

- Volodya

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk