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

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jun 11 09:31:44 CEST 2005


On Fri, 10 Jun 2005, Liaw, Andy wrote:

> I'm not familiar with Solaris, so take this with appropriate dose of NaCl...
>
> For the 64-bit build, why not have the -O2 for gcc, since you have it for
> g77 and g++?  If you just run vanilla configure for the 32-bit build, I
> believe it uses -O2 for all three compilers by default.  If that's the
> difference, perhaps it's sufficient to explain the performance difference.

CFLAGS was not specified, so should default to "-g -O2".  It is definitely 
worth checking, although almost all the time in these tests will be spent 
in Fortran code.

> The other thing is that solve(), and to some extent lm(), can benefit from
> an optimized BLAS.  You might want to check if the two builds are using
> equivalent BLAS.

He said:

>> neither build uses a BLAS.

Well, they do, the one supplied with R (which is in Fortran).

To supplement my timings earlier, with an optimized BLAS I gave

32-bit
[1] 4.99 0.03 5.02 0.00 0.00
64-bit
[1] 5.25 0.03 5.29 0.00 0.00

and for gcc 3.4.3 and the internal BLAS (which I had to build for these 
tests) I get

32-bit
[1]  9.96  0.09 10.12  0.00  0.00
64-bit
[1]  9.93  0.04 10.04  0.00  0.00

so I am not seeing anything like the same performance difference between 
32- and 64-bit builds (but it could well depend on the particular Sparc 
chip).

There are some problems in which the 64-bit builds _are_ much slower: 
complex matrix arithmetic is one (presumably because less effort has been 
spent on optimizing that).

>
> Andy
>
>> From: Scott Gilpin
>>
>> 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:

-- 
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-help mailing list