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

Jan de Leeuw deleeuw@stat.ucla.edu
Mon, 12 Nov 2001 17:42:59 -0800

We have two versions of R-1.3.1. The first one is the Carbon version
of Stefano Iacus. This is a CFM/PEF version, so it can run on OS 9.x
and on OS X 10.x. We can run this version in OS 9.x in two ways: by
booting into OS (.x and by running it in the Classic environment in
OS X.  The second version we use is the Darwin/X11 version,
which only runs on OS X 10.x, because it is a Mach-O program.

We have a single G4 with two 800MHz CPU's. It runs MacOS
9.2.2b7c2 and MacOS X 10.1.2 (5M64).

We have a single test. Define

hilbert<-function(n) 1/(outer(seq(n),seq(n),"+")-1)

where xxx is either 500 or 1000.

For xxx equal to 500 we need 21 seconds under OS 9, 20 seconds
under OS 10, and 14 seconds under Darwin. It requires 21
seconds under Classic.

For xxx equal to 1000 we need 177 seconds under OS 9, 173
seconds under OS 10, and 126 seconds under Darwin. Classic
uses 176 seconds.

Thus for this particular example Darwin is about 40% faster than
OS 10 Carbon, which may be about 1-2% faster than OS 9 Carbon.
There can be various reasons, of course. The compilers are
different. CFM applications are translated by the OS to
Mach-O applications, which could take some time. It is quite
possible that SMP works better for Mach-O under Darwin
(this is a two-processor machine, after all). In any case, the
speed difference seems significant.

It does not seem to make a difference if we run the Carbon program
natively in OS X, or natively in OS 9, or in Classic in OS X. That's
quite remarkable. Of course if we want to run it natively under OS 9
we have to give R a lot of memory, and both in OS 9 and Classic
the cooperative MP freezes the system during the computations.
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
homepage: http://www.stat.ucla.edu/~deleeuw
           No matter where you go, there you are. --- Buckaroo Banzai