Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2003-10-14 11:47:45


Hi again,

Going back to the tests I've done and looking at the output from -d+10, I realized find-project-root (project-roots.jam, line 62) was taking too long.
Since in my test project-root.jam is fixed, I changed find-project-root in order to return a fixed string and not do the processing every time it is called.
This changed data from:

# files 1 Elapsed: 0.611 seconds
# files 5 Elapsed: 0.822 seconds
# files 10 Elapsed: 1.082 seconds
# files 50 Elapsed: 3.314 seconds
# files 100 Elapsed: 6.239 seconds
# files 200 Elapsed: 12.588 seconds
# files 300 Elapsed: 20.501 seconds
# files 500 Elapsed: 37.964 seconds
# files 1000 Elapsed: 92.283 seconds

to:

# files 1 Elapsed: 0.621 seconds
# files 5 Elapsed: 0.771 seconds
# files 10 Elapsed: 1.021 seconds
# files 50 Elapsed: 2.894 seconds
# files 100 Elapsed: 5.397 seconds
# files 200 Elapsed: 10.455 seconds
# files 300 Elapsed: 16.344 seconds
# files 500 Elapsed: 28.842 seconds
# files 1000 Elapsed: 71.844 seconds

which is quite impressive!

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?

Pedro

 ------=_NextPart_000_015F_01C3927B.4686D4E0 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 bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi again,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Going back to the tests I've done and looking at
the output from -d+10, I realized find-project-root (project-roots.jam, line 62)
was taking too long.</FONT></DIV>
<DIV><FONT face=Arial size=2>Since in my test project-root.jam is fixed, I
changed find-project-root in order to return a fixed string and not do the
processing every time it is called.</FONT></DIV>
<DIV><FONT face=Arial size=2>This changed data from:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2># files&nbsp;&nbsp;&nbsp; 1
Elapsed:&nbsp;&nbsp; 0.611 seconds<BR># files&nbsp;&nbsp;&nbsp; 5
Elapsed:&nbsp;&nbsp; 0.822 seconds<BR># files&nbsp;&nbsp; 10
Elapsed:&nbsp;&nbsp; 1.082 seconds<BR># files&nbsp;&nbsp; 50
Elapsed:&nbsp;&nbsp; 3.314 seconds<BR># files&nbsp; 100 Elapsed:&nbsp;&nbsp;
6.239 seconds<BR># files&nbsp; 200 Elapsed:&nbsp; 12.588 seconds
<DIV><FONT face="Courier New" size=2># files&nbsp; 300 Elapsed:&nbsp; 20.501
seconds<BR># files&nbsp; 500 Elapsed:&nbsp; 37.964 seconds<BR># files 1000
Elapsed:&nbsp; 92.283 seconds</FONT></DIV></FONT><FONT face=Arial
size=2></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>to:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>
<DIV><FONT face="Courier New" size=2># files&nbsp;&nbsp;&nbsp; 1 Elapsed:&nbsp;
0.621 seconds<BR># files&nbsp;&nbsp;&nbsp; 5 Elapsed:&nbsp; 0.771 seconds<BR>#
files&nbsp;&nbsp; 10 Elapsed:&nbsp; 1.021 seconds<BR># files&nbsp;&nbsp; 50
Elapsed:&nbsp; 2.894 seconds<BR># files&nbsp; 100 Elapsed:&nbsp; 5.397
seconds<BR># files&nbsp; 200 Elapsed: 10.455 seconds<BR># files&nbsp; 300
Elapsed: 16.344 seconds<BR># files&nbsp; 500 Elapsed: 28.842 seconds<BR># files
1000 Elapsed: 71.844 seconds</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV></DIV>
<DIV><FONT face=Arial size=2>which is quite impressive!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Note that, for 1000
files,&nbsp;find-project-root&nbsp;is called 3008 times and returing a fixed
string reduced the gross time from 22056 ms to 10 ms.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Would it be possible to cache the value instead of
globbing every time? Is there a map-like container in jam?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Pedro</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BODY></HTML>
 ------=_NextPart_000_015F_01C3927B.4686D4E0--


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