Thanks for mentioning my 2016 paper on distance correlation: a SAS macro that uses PROC DISTANCE and DATA steps to compute distance correlation. Brute force computation of the estimators for distanmce correlation is indeed less than efficient. There is a newer algorithm that is more efficient, and also far more complex; see the paper by Huo, X et al. (2015) Fast computing for distance covariance. Technometrics. URL (free access on arxiv.org): http://arxiv.org/pdf/1410.1503.pdf