It is no news that R’s default BLAS is much slower that other available BLAS implementations. In A trick to speed up R matrix calculation/ Yu-Sung Su recommends using the ATLAS BLAS which is available on CRAN. When I learned about the possible speed-up a while ago I tried several BLAS libraries and I found that GotoBLAS2 was giving me the best performance among the open-source BLAS implementations. Today I decided to check once again how much it makes sense to replace R’s default BLAS library.
Here are some results from my Intel i7-620M laptop running Windows 7:
I used rbenchmark for the measurements with the default of 100 repetitions and I saved and reused the same matrix across all runs:
A = matrix(rnorm(1000*1000),ncol=1000)
benchmark(A %*% A)
A %*% A
If you are using R operations that rely on BLAS than you should always use a faster BLAS implementation. If you are using Windows, you can use the Rblas.dll from here or you try the Revolution R Community edition which comes with a MKL BLAS.