[Rcpp-devel] R/Rcpp/RcppEigen Optimization WAS: NumericVector Double mismatch when indexing an array

Darren Cook darren at dcook.org
Wed Oct 24 01:01:18 CEST 2012


> What gives?  What I found that does speed up the code dramatically
> is the -march switch.  I guess that can't be repo-ed because it is
> CPU dependent, right?  Here's the important settings that I used to
> compile R from source:
> 
> CC="gcc"
> CFLAGS="-g -O2 -march=amdfam10"
> CXX="g++"
> CXXFLAGS="-g -O2 -march=amdfam10"
> 
> With these settings...
> 
> MCMC Code    Switches        Relative Time
> R        none or -O2        1.0
> RcppEigen    none or -O2        0.09
> R        -O2 -march=amdfam10    0.5
> RcppEigen    -O2 -march=amdfam10    0.013

Wow, those are huge differences. Am I misreading, or does that say
RcppEigen runs *seven* times quicker with the -march=amdfam10 option?

Can that be explained? (e.g. does the AMDFAM10 processor have some
feature that speeds it up 7 times in ideal conditions?)

Darren

-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


More information about the Rcpp-devel mailing list