|
Boost-Build : |
From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2003-10-14 12:24:00
Hi Rene,
> 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.
Excellent. Thanks for the tip.
> 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.
# files 1 Elapsed: 0.641
# files 5 Elapsed: 0.791
# files 10 Elapsed: 1.031
# files 50 Elapsed: 3.085
# files 100 Elapsed: 5.699
# files 200 Elapsed: 11.236
# files 300 Elapsed: 17.304
# files 500 Elapsed: 34.179
# files 1000 Elapsed: 79.064
Not bad: a 10% reduction!
Thanks for the help.
Rene or Volodya: can you please put this in the CVS?
Pedro
------=_NextPart_000_0182_01C39280.569C2A10 Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2733.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi Rene,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>> No map like container... but, you an use a set
of variables to gt a similar<BR>> effect. If you have some keys-values you
can:<BR>> <BR>> xmap-$(key1) = $(value1) ;<BR>>
xmap-$(key2) = $(value2) ;<BR>>
...etc.<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Excellent. Thanks for the tip.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>> But looking at find-project-root the simple
answer is to cache the searches.<BR>> Like so:<BR>> <BR>> rule
find-project-root ( dir )<BR>> {<BR>> local location =
$(.project-root.$(dir)) ;<BR>> if ! $(location)<BR>>
{<BR>> location
= [ path.glob $(dir) : project-root.jam ] ;<BR>> }<BR>>
if ! $(location)<BR>> {<BR>>
location = [ path.glob-in-parents
$(dir) : project-root.jam ] ;<BR>> }<BR>>
.project-root.$(dir) = $(location) ;<BR>>
return $(location) ;<BR>> }<BR>> <BR>> Try thatand
see what the impact on timming is.<BR></FONT></DIV>
<DIV><FONT face="Courier New" size=2># files 1 Elapsed:
0.641<BR># files 5 Elapsed: 0.791<BR># files 10
Elapsed: 1.031<BR># files 50 Elapsed: 3.085<BR># files 100
Elapsed: 5.699<BR># files 200 Elapsed: 11.236<BR># files 300
Elapsed: 17.304<BR># files 500 Elapsed: 34.179<BR># files 1000 Elapsed:
79.064</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Not bad: </FONT>a 10% reduction!</FONT></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for the help.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Rene or Volodya: can you please put this in the
CVS?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Pedro</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0182_01C39280.569C2A10--
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