On Mon, May 4, 2015 at 2:37 PM, Dirk Eddelbuettel <[email protected]> wrote:
> > On 4 May 2015 at 14:23, Tim Keitt wrote: > | > | > | On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni < > [email protected]> > | 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 | [email protected] > _______________________________________________ > Rcpp-devel mailing list > [email protected] > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel > -- http://www.keittlab.org/
_______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
