[Rcpp-devel] R vectorisation vs. C++ vectorisation

Douglas Bates bates at stat.wisc.edu
Tue Nov 20 16:58:30 CET 2012

On Tue, Nov 20, 2012 at 9:54 AM, Hadley Wickham <h.wickham at gmail.com> wrote:

> > P.S. I don't think the sugar versions can be made any quicker, because
> > they have to allocate intermediate vectors, and do more memory copies.
> I don't think they _have_to - my understanding is that the expression
> template approach is general enough that you could compile away those
> intermediates.  It may be extremely difficult to do though!

That's the issue in delayed evaluation.  You do a lot of template magic to
discover how the result is going to be used before you evaluate it.  It has
its place but for cases like this it seems like what Ed Deming would have
called "burning the toast and then scraping it".

> Hadley
> --
> RStudio / Rice University
> http://had.co.nz/
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121120/6b86b827/attachment.html>

More information about the Rcpp-devel mailing list