Skip to content
Prev 34233 / 63424 Next

How do I access class slots from C?

On 09/30/2009 09:51 AM, Abhijit Bera wrote:
Essentially you are not using a C only approach, even in your original 
example, since you call functions from fPortfolio (btw, R has to look 
down the search path each time to find the function, so you can make 
this more efficient, ...)

It might even be faster like this since you only need to parse the R 
functions once, so you pay the (not so expensive btw) price of parsing 
once.

Combine this with an approach that caches the references to the 
functions, so you only pay the price of searching through R search path 
once, and you're set.

Anyway, chances are the code from fPorfolio you call will be what costs 
the most, after all that is what is actually working here. Before 
converting your R script to C, did you do some profiling to identify 
what takes the most time ?

Romain