picrust/picrust — pull request #124 by wasade (2013-06-14 21:58:32+00:00)
Title: Predict traits speedups

There were a large number of uses of ``TreeNode.getNodeMatchingName`` which require full tree traversals on each call. In addition, there were a few instances of performing list lookups instead of using structures optimized for random access. These changes resulted in my smallish test case (16000 tips, 2 genomes) going from 1200 seconds to 280 seconds. I have not benched on a full tree yet.

Profiling indicates that, on the test case above, the bulk of the time is now spent in ``PhyloNode.tipToTipDistances``. Based on the verbose output at runtime, and how the code is structured, it appears that distances for all nodes are being calculated. This is incredibly expensive, both in space and time, and may need to be revisited.

I removed a lot of extraneous code comments, and there is likely more to do. In general, it is better to remove code than to comment it out as it can be misleading and increase complexity during code maintenance.