[Rd] eval(SEXP fn,SEXP rho) in C++ code

From: Patricia Bautista <pbautist2_at_yahoo.com.mx>
Date: Thu 28 Sep 2006 - 02:29:30 GMT

Hi r-devel,

I am working on a R extension. I am writing the function in C++, and in my function it is required a R function object from the user. This R function object will be evaluated thousand of times in my C++ code. I generated the shared library and I loaded it on R. I did several experiments in order to compare the speed of my compiled code vs the speed of the equivalent interpreted code. I was surprise!, the better was the interpreted code!. Then, I ask myself: What is the benefit of compiled code??. I think my problem is in using the function "eval(SEXP f, SEXP rho)" because it takes time!. Am I right?. Then, can someone tell me what the benefit of using compiled code is?, or can someone give me a reference to look into?.

Thanks in advanced,
Patricia B.

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Sep 28 12:36:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 28 Sep 2006 - 03:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.