[Rcpp-devel] Question on performance

Michael Weylandt michael.weylandt at gmail.com
Sat Sep 22 19:36:37 CEST 2018


I don't have time right now, but the offending line is here:

https://github.com/jesusfv/Comparison-Programming-Languages-Economics/blob/master/RBC_Rcpp.R#L62

which calls `sourceCpp` repeatedly on each loop iteration.

Should be a one line change to move it outside the loop and un-sully the
good name of Rcpp.

M

On Sat, Sep 22, 2018 at 12:31 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 22 September 2018 at 19:15, Iñaki Ucar wrote:
> | FYI, you can find the code here:
> |
> | https://github.com/jesusfv/Comparison-Programming-Languages-Economics
>
> Nice catch!
>
> Have not had time to look.  Any volunteers willing to dive in, ie fork or
> clone the thing and clean up?  Happy to help.
>
> Dirk
>
> |
> | El sáb., 22 sept. 2018 a las 15:11, Dirk Eddelbuettel
> | (<edd at debian.org>) escribió:
> | >
> | >
> | > Jordi,
> | >
> | > On 22 September 2018 at 09:18, Georgi Boshnakov wrote:
> | > | I don’t see any code going with the revised version, but
> | > | looking at the code coming with the original paper, see
> http://economics.sas.upenn.edu/~jesusfv/RBC_codes.zip,
> | > | the following points come up:
> | >
> | > All excellent points.  Jordi, you should ask for the code.  It really
> sounds
> | > like something done either naively, or with a goal in mind.  "Rcpp
> code is
> | > C++ code" so any "N times" is silly -- setup costs, extra copies, ...
> etc pp.
> | >
> | > We may of course copy at the end from, say, bespoke C++ data
> structures to
> | > ours.  But for any non-trivial example the cost of that will be well
> under, say, 1%
> | > while still getting a "many times" speedup over alternative R
> solutions.  So
> | > a win for most people.  Hence 1444 packages on CRAN using it. Those
> people
> | > aren't all fools ...
> | >
> | > Dirk
> | >
> | > --
> | > http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> | > _______________________________________________
> | > 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
> |
> |
> |
> | --
> | Iñaki Ucar
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
> _______________________________________________
> 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/20180922/708c996e/attachment.html>


More information about the Rcpp-devel mailing list