# [R-SIG-Mac]timing R and R and R and R

**Thomas Lumley
**
tlumley@u.washington.edu

*Sat, 17 Nov 2001 11:27:38 -0800 (PST)*

On Thu, 15 Nov 2001, Jan de Leeuw wrote:
>* ATLAS is a portable fast BLAS (basic linear algebra subroutines),
*>* which itself is a library of elementary linear algebra routines.
*>* LAPACK consists of more elaborate linear algebra routines
*>* build on top of the BLAS. It is possible to optimize the BLAS
*>* for the system that it will be running on at compile time. I dont
*>* know the details, but ATLAS does an enormous number of compile
*>* time checks and optimizations, which can result in a major
*>* speed increase in linear algebra computations.
*
ATLAS is the Automatically Tuned Linear Algebra Software. It is a very
clever approach to optimizing the low-level linear algebra operations that
underly things like Jan's eigen() benchmark. The package is at
http://math-atlas.sourceforge.net/
The idea is that the main optimisation method for linear algebra
operations is to tune the loop unrolling in matrix multiplications to
maximise cache use. This is traditionally done by careful analysis of the
data flow, but ATLAS substitutes brute force -- it tries lots of different
things to find the ones that work best.
It turns out that ATLAS is often comparable to the hand-optimised linear
algebra code produced by workstation vendors, and so for PCs is better
than you are likely to get by any other means. However, most of the
improvement is specific to a chipset/CPU/clock speed, and ATLAS really
should be recompiled for each different machine. This might be feasible
for Macs, as there's only a few new Macs each year.
-thomas