<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 4, 2015 at 2:37 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 4 May 2015 at 14:23, Tim Keitt wrote:<br>
|<br>
|<br>
| On Sun, May 3, 2015 at 11:29 PM, Antonio Piccolboni <<a href="mailto:antonio@piccolboni.info">antonio@piccolboni.info</a>><br>
| wrote:<br>
|<br>
|     Check here  for something similar to Tim's solution that preallocates all<br>
|     vectors to avoid the costly push_back. Still needs the unlists in R, so<br>
|     it's expensive in that dimension, the number of lists in the output.<br>
|<br>
|<br>
| I may have a way around the unlist part; still needs testing.<br>
<br>
</span>Keep us posted.<br>
<span class=""><br>
| push_back is amortized constant so only a little costly.<br>
<br>
</span>But going from std::list to SEXP is one full copy.  Not so bad in the grand<br>
scheme of things.<br></blockquote><div><br></div><div>Copying is where all the costs accumulate for sure. I find it mostly guesswork whether something copies or not with Rcpp data structures.</div><div><br></div><div>THK</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div></div>
</div></div>