Is it okay to provide squaredDistance instead of distance? sum_i dist(a_i, b_i)^2 is more common than sum_i dist(a_i, b_i). Note that Mahout's implementation would use an approximation if two vectors are close to orthogonal, which is faster for randomly generated vectors. It might run faster for high dimensional data, but it becomes much slower if the two vectors are not close to orth.