[Rd] the incredible lightness of crossprod

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jan 28 10:00:06 CET 2005


On Fri, 28 Jan 2005, Uwe Ligges wrote:

> Patrick Burns wrote:
>
>> On my machine the versions are all precompiled R, and I would
>> be very surprised if the same were not the case on the client's
>> machine.  That is, no specially compiled BLAS.
>
> Hmmm. I always install using some advanced BLAS: On Windows, e.g., simply 
> using the Rblas.dll provided by Brian Ripley, on Linux it's really no effort 
> to compile it yourself.
>
> For huge matrices you can use your some-years-old-desktop machine (with some 
> advanced BLAS) to outperform expensive multi-CPU machines (without advanced 
> BLAS).

As I think has been noted earlier, there is often some loss for 
moderately-sized matrices.  When Doug Bates first used dgemm for %*% and 
crossprod, it made the R tests run noticeably slower on the (70MHz)
Solaris machines I was using at the time.  But that price is paid whether 
you have an optimized BLAS or not.

But anyone working with 100+ diml matrices should try an optimized BLAS. 
Building ATLAS can be a bit painful (especially as you really need a 
shared library for use with R), but often prebuilt versions are available 
(e.g. Goto's BLAS and atlas on Debian and Windows).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list