On August 11, 2010 02:48:23 am [email protected] wrote:
> Le 10 août 2010 à 22:10, baptiste auguie 
<[email protected]> a écrit :
> > OK, thanks. I have not been able to produce a minimal code that
> > would exhibit an improved performance using this
> > passing-by-reference idea.
> 
> Hi,
> 
> It would usually make a difference when copying the object that is
> passed by value is "expensive" to copy. Rcpp objects are very cheap
> to copy and both copies refer to the same actual data (the same
> SEXP).
> 
> For internal code my recommendation would be to always use pass by
> reference and do an explicit call to clone when a real copy
> (different SEXP) is needed.

In other words, if you were passing large arma::mat's, then const 
references should make a real difference.

Davor
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to