Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rllvm and compiler packages: R compilation

Tags:

r

This is a fairly general question about the future of R: Any hope to see a merger of compilerand Rllvm (from Omegahat) or another JIT compilation scheme for R (I know there is Ra, but not updated recently)?

In my tests the speed gain from compiler are marginal for "complicated" functions...

like image 896
teucer Avatar asked Dec 06 '22 22:12

teucer


1 Answers

What matters isn't how complicated a function is but what kinds of computations it performs. The compiler will make most difference for functions dominated by interpreter overhead, such as ones that perform mostly simple operations on scalar or other small data. In cases like that I have seen a factor of 3 for artificial examples and a a bit better than a factor of 2 for some production code. Functions that spend most of their time in operations implemented in native code, like linear algebra operations, will see little benefit.

This is just the first release of the compiler and it will evolve over time. LLVM is one of several possible direction we will look at but probably not for a while. In any case, I would expect using something like LLVM to provide further improvements in cases where the current compiler already makes a difference, but not to add much in cases where it does not.

like image 172
Luke Tierney Avatar answered Dec 26 '22 00:12

Luke Tierney