Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-20 17:39:01


Ali Azarbayejani <ali_at_[hidden]> writes:

>> I'm very interested in do-nothing timing. Can you run "bjam -d+10" on an
>> unmodified tree and send me the output. This will tell what consumes most
>> time.
>
> Attached.

It looks like we're spending a /lot/ of time in
sequence.insertion-sort.

Please try the following patch. If it helps at all we can also try
to rewrite this function in 'C' for speed.

-------

*** sequence.jam.~1.11.~ Tue Jan 14 20:11:27 2003
--- sequence.jam Thu Mar 20 17:37:07 2003
***************
*** 59,75 ****
local caller = [ CALLER_MODULE ] ;
ordered ?= sequence.less ;
local result = $(s[1]) ;
! for local x in $(s[2-])
{
local head tail ;
! tail = $(result) ;
! while $(tail) && [ modules.call-in $(caller) : $(ordered) $(tail[1]) $(x) ]
{
! head += $(tail[1]) ;
! tail = $(tail[2-]) ;
}
- result = $(head) $(x) $(tail) ;
}
return $(result) ;
}

--- 59,94 ----
local caller = [ CALLER_MODULE ] ;
ordered ?= sequence.less ;
local result = $(s[1]) ;
! if $(ordered) = sequence.less
{
local head tail ;
! for local x in $(s[2-])
{
! head = ;
! tail = $(result) ;
! while $(tail) && ( $(tail[1]) < $(x) )
! {
! head += $(tail[1]) ;
! tail = $(tail[2-]) ;
! }
! result = $(head) $(x) $(tail) ;
! }
! }
! else
! {
! for local x in $(s[2-])
! {
! local head tail ;
! tail = $(result) ;
! while $(tail) && [ modules.call-in $(caller) : $(ordered) $(tail[1]) $(x) ]
! {
! head += $(tail[1]) ;
! tail = $(tail[2-]) ;
! }
! result = $(head) $(x) $(tail) ;
}
}
+
return $(result) ;
}

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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