Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Dirk Eddelbuettel
On 12 March 2012 at 00:43, Kaveh Vakili wrote: | Dear Prof Bates, | | i have started to account for the difference | in performances between the cpp only and the | rcpp. | | ctrl-f ing the rcpp docs does not give much | on manipulation of float. Is there a way, in | rcpp, to use the fact th

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Kaveh Vakili
Dear Prof Bates, i have started to account for the difference in performances between the cpp only and the rcpp. ctrl-f ing the rcpp docs does not give much on manipulation of float. Is there a way, in rcpp, to use the fact that some parts of the algorithm are float-safe? (,SEXP R_x,..

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Douglas Bates
On Sat, Mar 10, 2012 at 6:05 PM, Kaveh Vakili wrote: > Hi Steve, > > Timing: > > i use: > > int start_s=clock(); > .. > .. > int stop_s=clock(); > cout << "time: " << (stop_s-start_s)/double(CLOCKS_PER_SEC)*1000 << endl; > > > Function: > Whatever it is, it's coming from these three functions (whe

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Dirk Eddelbuettel
On 11 March 2012 at 17:04, Kaveh Vakili wrote: | | Dear Jared, | | thank you on so many levels: | | A) you have understood my question (no, i'm not asking for free consulting, | yes i'm comparing pur c++ and rcpp and yes this is the part of the code | that has the difference in timing --the r

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Kaveh Vakili
Dear Jared, thank you on so many levels: A) you have understood my question (no, i'm not asking for free consulting, yes i'm comparing pur c++ and rcpp and yes this is the part of the code that has the difference in timing --the rest of the code times roughtly the same, no i'm not calling bac

Re: [Rcpp-devel] rcpp overhead

2012-03-11 Thread Jared Murray
I don't have the answer to his question, but it looks like he's not comparing R to Rcpp/C++ but rather "pure" C++ to Rcpp/C++. And the suspect code he posted isn't doing anything obviously (to me) silly, like repeatedly calling back into R (of course it would have bigger problems trying to do that

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Dirk Eddelbuettel
On 11 March 2012 at 01:33, Kaveh Vakili wrote: | | >Don't take this the wrong way, but we are not here to debug or rewrite your | >code for you. | | | Thanks Dirk, but i'm not asking for this either. | | The code worksonly it doesn't time the same. | My question is: is it normal -- is th

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Kaveh Vakili
>Don't take this the wrong way, but we are not here to debug or rewrite your >code for you. Thanks Dirk, but i'm not asking for this either. The code worksonly it doesn't time the same. My question is: is it normal -- is there an overhead in using rcpp and how large is it, typically?

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Dirk Eddelbuettel
On 11 March 2012 at 01:05, Kaveh Vakili wrote: | Hi Steve, | | Timing: | | i use: | | int start_s=clock(); | .. | .. | int stop_s=clock(); | cout << "time: " << (stop_s-start_s)/double(CLOCKS_PER_SEC)*1000 << endl; Don't take this the wrong way, but we are not here to debug or rewrite your cod

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Kaveh Vakili
Hi Steve, Timing: i use: int start_s=clock(); .. .. int stop_s=clock(); cout << "time: " << (stop_s-start_s)/double(CLOCKS_PER_SEC)*1000 << endl; Function: Whatever it is, it's coming from these three functions (when i uncoment them, the rest of the code runs in comparable speed). using name

Re: [Rcpp-devel] rcpp overhead

2012-03-10 Thread Steve Lianoglou
Hi Kaveh, On Sat, Mar 10, 2012 at 5:58 PM, Kaveh Vakili wrote: > Hi all, > > the same code when timed in cpp (i.e. without any interfacing with R) > runs about 2 times faster than when called from R and timed from R's > system.time(). In this type of overhead normal or is it a sign i'm doing >