List Info

Thread: massive potential JAM speedup




massive potential JAM speedup
user name
2007-12-08 14:55:04

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

 

WouldnR17;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 targetR17;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 216;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̵7;t break anything?

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

 

Kind regards

--

Jan

 

 

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )