for some of these calculations? There is a perl module Statistics::R that implements a bridge between perl and R. Doing correlations and such in R is generally C-based, but with some vectorized optimizations for matrix operations. You might try some of your calculations to see what speed gains you might see (probably significant).