[Rcpp-devel] First foray into Rcpp and comparison of speed with R

Gregor GORJANC gregor.gorjanc at bf.uni-lj.si
Thu Sep 1 19:48:50 CEST 2011


>
> |     We usually do
> |
> |      Rcpp::List ret = Rcpp::List::create(Rcpp::Named("pa", pa),
> |                                          Rcpp::Named("w", w);
> |                                          Rcpp::Named("xa", xa));
> |      return ret;
> |
> |     to avoid re-allocation.  But that is minuscule, and your code is
> arguably
> |     as easy or easier to read :)
> |
> |
> | Did I understand correctly that your proposal is to create return object
> all in
> | one spot to avoid changing it as I did three times?
>
> Yup!


Just a note. I see a little speedup using your return suggestion so once
again for this!

gg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110901/3bbd57f6/attachment.htm>


More information about the Rcpp-devel mailing list