On Mon, May 4, 2015 at 2:37 PM, Dirk Eddelbuettel <e...@debian.org> wrote:
> > On 4 May 2015 at 14:23, Tim Keitt wrote: > | > | > | On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni < > anto...@piccolboni.info> > | wrote: > | > | Check here for something similar to Tim's solution that > preallocates all > | vectors to avoid the costly push_back. Still needs the unlists in R, > so > | it's expensive in that dimension, the number of lists in the output. > | > | > | I may have a way around the unlist part; still needs testing. > > Keep us posted. > > | push_back is amortized constant so only a little costly. > > But going from std::list to SEXP is one full copy. Not so bad in the grand > scheme of things. > Copying is where all the costs accumulate for sure. I find it mostly guesswork whether something copies or not with Rcpp data structures. THK > > Dirk > > -- > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > _______________________________________________ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- http://www.keittlab.org/
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel