biocore/unifrac

Length multiplication for weighted metrics can be migrated higher in the stack

wasade opened this issue · 1 comments

This removes a fair number of multiplication operations from the inner loop to higher in the stack reducing the number of times a length multiplication is done from O(N^2) to O(N). For weighted metrics, we're basically doing fabs(a - b) * length where a and b are proportions. We can instead do the length multiplication on the proportion vector prior to the execution of a task. This would not work for the moment with unweighted metrics.

Almost certainly addressed with the recent massive overhauls