[R] Performance difference between 32-bit build and 64-bit build on Solaris 8

From: Scott Gilpin <sgilpin_at_gmail.com>
Date: Sat 11 Jun 2005 - 06:57:29 EST


Hi everyone -

I'm seeing a 32-bit build perform significantly faster (up to 3x) than a 64 bit build on Solaris 8. I'm running R version 2.1.0. Here are some of my system details, and some resulting timings:

>uname -a

SunOS lonetree 5.8 Generic_117350-16 sun4u sparc SUNW,Sun-Fire-V440

lonetree /home/sgilpin >gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.2/specs Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.2

I built the 32 bit version of R with no changes to config.site. I built the 64 bit version with the following in config.site:

CC="gcc -m64"
FFLAGS="-m64 -g -02"
LDFLAGS="-L/usr/local/lib/sparcv9 -L/usr/local/lib" CXXFLAGS="-m64 -g -02"

neither build uses a BLAS. Both builds are installed on the same machine, and the same disk. The machine has virtually no load; R is one of the only processes running during these timings:

First comparison: solve on a large matrix

>echo 'set.seed(1);M<-matrix(rnorm(9e6),3e3);system.time(solve(M))' |
/disk/loneres01/R-2.1.0-32bit/bin/R -q --vanilla
> set.seed(1);M<-matrix(rnorm(9e6),3e3);system.time(solve(M))
[1] 713.45 0.38 713.93 0.00 0.00
>

>echo 'set.seed(1);M<-matrix(rnorm(9e6),3e3);system.time(solve(M))' |
/disk/loneres01/R-2.1.0-64bit/bin/R -q --vanilla
> set.seed(1);M<-matrix(rnorm(9e6),3e3);system.time(solve(M))
[1] 2277.05 0.31 2278.38 0.00 0.00
>

Second comparison: linear regression

lonetree /home/sgilpin/R >echo 'set.seed(1); y<-matrix(rnorm(10000*500),500);
x<-matrix(runif(500*100),500);
system.time(fit<-lm(y~x))' | /disk/loneres01/R-2.1.0-32bit/bin/R -q --vanilla
> set.seed(1);y<-matrix(rnorm(10000*500),500);x<-matrix(runif(500*100),500);system.time(fit<-lm(y~x))
[1] 23.34 0.80 24.17 0.00 0.00
>

lonetree /home/sgilpin/R >echo 'set.seed(1); y<-matrix(rnorm(10000*500),500);
x<-matrix(runif(500*100),500);
system.time(fit<-lm(y~x))' | /disk/loneres01/R-2.1.0-64bit/bin/R -q --vanilla
> set.seed(1);y<-matrix(rnorm(10000*500),500);x<-matrix(runif(500*100),500);system.time(fit<-lm(y~x))
[1] 55.34 0.70 56.21 0.00 0.00
>

Final comparison: stats-Ex.R (from R-devel) lonetree /home/sgilpin/R >time /disk/loneres01/R-2.1.0-32bit/bin/R -q --vanilla CMD BATCH stats-Ex.R

real 1m4.042s
user 0m47.400s
sys 0m10.390s
lonetree /home/sgilpin/R >time /disk/loneres01/R-2.1.0-64bit/bin/R -q --vanilla CMD BATCH stats-Ex.R

real 1m20.017s
user 1m3.590s
sys 0m10.130s

I've seen Prof. Ripley and others comment that a 64 bit build will be a little slower because the pointers are larger, and gc() will take longer, but these timings seem out of this range.

Any thoughts?



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jun 11 07:02:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:31 EST