Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R 2.14 byte compilation - how much performance increase

I saw that the latest R version supports byte compilation. What is the performance gain I can expect? And are specific tasks more positively impacted that others?

like image 405
Paul Hiemstra Avatar asked Dec 01 '11 16:12

Paul Hiemstra


1 Answers

It is a good question:

  • The byte compiler appeared with 2.13.0 in April, and some of us run tests then (with thanks to gsk3 for the links).

  • I tend to look more at what Rcpp can do for us, but I now always include 'uncompiled R' and 'byte compiled R' as baselines.

  • I fairly often see gains by a factor of two (eg the varSims example) but also essentially no gains at all (the fibonacci example which is of course somewhat extreme).

We could do with more data. When we had the precursor byte compile in the Ra engine by Stephen Milborrow (which I had packaged up for Debian too), it was often said that both algebraic expression and loops benefited. I don't know of a clear rule for the byte compiler by Luke Tierney now in R---but it generally never seems to hurt so it may be worthwhile to get into the habit of turning it on.

like image 69
Dirk Eddelbuettel Avatar answered Oct 18 '22 20:10

Dirk Eddelbuettel