[jamming] massive potential JAM speedup

Jan van Valburg jan at rpgfan.demon.co.uk
Sat Dec 8 12:55:04 PST 2007


Hi this e-mail is for anyone who has knowledge of the JAM source-code,
in particular the make0includes function.

 

I have been looking at speeding up JAM, in particular the make0includes
function.

This function does two things:

1)       for each target, collect all includes below it in the hierarchy
and add it to it's own list

2)       call itself for all it's children in the hierarchy

 

Wouldn't it be more optimal to do step 2 first?

1)       recurse down the hierarchy until we reach a leaf

2)       as we recurse back up the hierarchy, propagate the includes
from the leaves to the root target

If we collect the includes for the targets at the bottom of the
hierarchy first (leaves), then as we work our way to the top(root) all
we have to do is add the includes of our children. We don't have to
recurse down the entire tree for every target, because the target's
direct children already have all the includes further down the tree.

 

Only two small changes are needed to make.c:

 

* in make0includes we move 'step 2' to after 'step 3'.

* in make0gatherincludes2 we comment out the line that reads

'chain = make0gatherincludes2(tname, chain, c->target);'

 

Making the change speeds up JAM by 10x. Functionality appears to be the
same.

 

Could anyone that's knowledgeable on JAM please verify for me that this
change doesn't break anything?

If anyone has any questions about this I'd be happy to answer them.

 

Kind regards

--

Jan

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://maillist.perforce.com/pipermail/jamming/attachments/20071208/ecf0689d/attachment.html


More information about the jamming mailing list