Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2003-10-14 12:00:30


[2003-10-14] Pedro Ferreira wrote:

>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.
>
>Would it be possible to cache the value instead of globbing every time? Is
there a
>map-like container in jam?

No map like container... but, you an use a set of variables to gt a similar
effect. If you have some keys-values you can:

xmap-$(key1) = $(value1) ;
xmap-$(key2) = $(value2) ;
...etc.

But looking at find-project-root the simple answer is to cache the searches.
Like so:

rule find-project-root ( dir )
{
local location = $(.project-root.$(dir)) ;
if ! $(location)
{
location = [ path.glob $(dir) : project-root.jam ] ;
}
if ! $(location)
{
location = [ path.glob-in-parents $(dir) : project-root.jam ] ;
}
.project-root.$(dir) = $(location) ;
return $(location) ;
}

Try that and see what the impact on timming is.

-- grafik - Don't Assume Anything
-- rrivera (at) acm.org - grafik (at) redshift-software.com
-- 102708583 (at) icq

 


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