From ripley at stats.ox.ac.uk  Fri Jan 28 10:00:06 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri Jan 28 10:15:14 2005
Subject: [Rd] the incredible lightness of crossprod
In-Reply-To: <41F9F552.7090501@statistik.uni-dortmund.de>
References: <41F907EA.90406@pburns.seanet.com> <41F9382E.2060200@stat.wisc.edu>
	<41F96807.1000405@pburns.seanet.com>
	<41F9F552.7090501@statistik.uni-dortmund.de>
Message-ID: <Pine.LNX.4.61.0501280852020.29864@gannet.stats>

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@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


[Rd] the incredible lightness of crossprod
Prof Brian Ripley