Skip to content


February 14, 2013

I’ve recently written my first R package using RcppArmadillo, but there are a few things about the performance of my code that puzzle me:

  • I switched from using the Hadamard (element-wise) product to taking the log and then summing, a common statistical practice. This appeared to make my code 50% slower, so I’ve backed out the change.
  • I compiled R from source using the Intel C, C++ & Fortran compilers on Linux and also replaced Rblas with MKL. The resulting code runs slower on my university’s SGI Altix cluster than the R compiled with gcc that was already available via PBS.
  • Most of the compute nodes in the SGI cluster are dual-CPU, Xeon E5-2670 (8 cores @2.66GHz), therefore I can run up to 16 compute threads on a single node. However, 16 threads is actually slower than 6 threads.


The relationship one would expect to see is that the elapsed time halves when the number of cores doubles (excluding some parallel overhead) while the CPU time remains constant (plus overhead). However, according to these CPU usage figures, the addition of more threads adds nothing but overhead:


Yep, looks pretty linear…

From → R

One Comment

Trackbacks & Pingbacks

  1. Numerical stability | Matt Moores

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Ella Kaye on Ella Kaye

Computational Bayesian statistics

Bayes' Food Cake

A bit of statistics, a bit of cakes. - Blogs to Learn R from the Community

Computational Bayesian statistics

Richard Everitt's blog

Computational Bayesian statistics

Let's Look at the Figures

David Firth's blog

Nicholas Tierney

Computational Bayesian statistics

Sweet Tea, Science

Two southern scientistas will be bringing you all that is awesome in STEM as we complete our PhDs. Ecology, statistics, sass.

Mad (Data) Scientist

Musings, useful code etc. on R and data science

Darren Wilkinson's blog

Statistics, computing, functional programming, data science, Bayes, stochastic modelling, systems biology and bioinformatics

(badness 10000)

Computational Bayesian statistics

Igor Kromin

Computational Bayesian statistics


I can't get no

Xi'an's Og

an attempt at bloggin, nothing more...

Sam Clifford

Postdoctoral Fellow, Bayesian Statistics, Aerosol Science

%d bloggers like this: