library(RLLVMCompile)
fib =
function(n)
{
if(n == 0L || n == 1L)
n
else
fib(n - 1L) + fib(n - 2L)
}
fc = compileFunction(fib, Int32Type, list(n = Int32Type))
.llvm(fc, 4)
if(FALSE) {
a = system.time(fib(30))
c = system.time(.llvm(fc, 30))
library(compiler)
ff = cmpfun(fib)
b = system.time(ff(30))
a/c # on OS X 1000 times faster.
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.