Scott Kostyshak
2014-Apr-24 20:10 UTC
[R-sig-Debian] 50% performance of custom R build compared to PPA R for a command
Hi, I have R installed from the Ubuntu PPA and a local build of R (more details below). I will refer to these as "R" and "R-devel", respectively. I've reproduced the following on Ubuntu 13.10 and 14.04. Below is an example (which requires the bootstrap package) that takes 10 seconds for me to run with R-devel and 5 seconds with R library(bootstrap) str(tooth) theta <- function(ind) { easy <- lm(strength ~ E1+E2, data=tooth, subset=ind) diffi<- lm(strength ~ D1+D2, data=tooth, subset=ind) (sum(resid(easy)^2) - sum(resid(diffi)^2))/13 } tooth.boot <- bootstrap(1:13, 2000, theta) I'm wondering if this is due to different compiler flags. For R, when installing the bootstrap package, I see gcc -std=gnu99 -shared -Wl,-Bsymbolic-functions -Wl,-z,relro -o bootstrap.so boott.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR For R-devel I see: ccache gcc -shared -L/usr/local/lib -o bootstrap.so boott.o -lgfortran -lm -lquadmath -L/usr/local/lib/R-devel/lib/R/lib -lR My install script for the local build is based on Dirk's script [1]. In particular, my configure command is: R_PAPERSIZE=letter R_BATCHSAVE="--no-save --no-restore" R_BROWSER=xdg-open PAGER=/usr/bin/pager PERL=/usr/bin/perl R_UNZIPCMD=/usr/bin/unzip R_ZIPCMD=/usr/bin/zip R_PRINTCMD=/usr/bin/lpr LIBnn=lib AWK=/usr/bin/awk CC="gcc" CFLAGS="-ggdb -pipe -std=gnu99 -Wall -pedantic" CXX="g++" CXXFLAGS="-ggdb -pipe -Wall -pedantic" FC="gfortran" F77="gfortran" MAKE="make -j$NJOBS" "${repoDir}/configure" --prefix=/usr/local/lib/R-devel --enable-R-shlib --with-blas --with-lapack --with-readline --without-recommended-packages > ../build-logs/configure 2>&1 I'm using R-devel updated to today's revision but I compiled a version from a year ago and had the same performance so that is why I suspect my installation script accounts for the differences. Any advice would be appreciated and please let me know if any other information would be helpful. Best, Scott [1] http://www.personal.psu.edu/mar36/blogs/the_ubuntu_r_blog/2012/08/installing-the-development-version-of-r-on-ubuntu-alongside-the-current-version-of-r.html -- Scott Kostyshak Economics PhD Candidate Princeton University
Dirk Eddelbuettel
2014-Apr-24 20:32 UTC
[R-sig-Debian] 50% performance of custom R build compared to PPA R for a command
Scott, My first quick hunches are a) 50% is too much for compiler switches, b) your examples shows R code, and c) are you sure you are using the same BLAS? What happens when you profile? Dirk -- Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
Seemingly Similar Threads
- ' --enable-R-shlib' problem when setting up R-devel in Linux Mint 17.1 64-bit
- ' --enable-R-shlib' problem when setting up R-devel in Linux Mint 17.1 64-bit
- Problems installing packages in FreeBSD 2.2.8 and R-0.62.2
- [PATCH] builder: use the template arch when caching all templates
- R 3.4 has broken C++11 support