[Rcpp-devel] Question on performance
El dom., 23 sept. 2018 13:01, I?aki Ucar <iucar at fedoraproject.org> escribi?:
Also you can try adding // [[Rcpp::plugins(unwindProtect)]] to InsideLoop.cpp. That should boost the performance too with the latest version of Rcpp.
Taking a look now, and I realize there are just calls to C++, not to R. So, please, forget about what I've said. The dangers of skimming through code in a mobile device and speaking too soon. I?aki
I?aki
El dom., 23 sept. 2018 a las 12:46, Kyle Baron (<kyleb at metrumrg.com>) escribi?:
I got mOutput mixed up with mResults in the last message; it mResults
that gets created up front and then every iteration.
https://github.com/jesusfv/Comparison-Programming-Languages-Economics/blob/master/InsideLoop.cpp#L12
On Sun, Sep 23, 2018 at 5:38 AM Kyle Baron <kyleb at metrumrg.com> wrote:
It seems like the sourceCpp thing is the biggie. That dropped about a
second of the time from something like 2.7 to 1.7 seconds
They also create mOutput and then re-create it every time it goes into
InsideLoop
https://github.com/jesusfv/Comparison-Programming-Languages-Economics/blob/master/InsideLoop.cpp#L12
I just passed mOutput into InsideLoop and modified it there
On Sat, Sep 22, 2018 at 1:21 PM Dirk Eddelbuettel <edd at debian.org>
wrote:
On 22 September 2018 at 12:36, Michael Weylandt wrote: | I don't have time right now, but the offending line is here: | |
| | 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. Nice catch!! You should _definitely_ send him a PR. I also suggest to
move
the sourceCpp() outside the timed segment as I do not think he
accounts for
compilation in the other approaches (eg C++). Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
_______________________________________________ Rcpp-devel mailing list Rcpp-devel at lists.r-forge.r-project.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
-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20180924/20d12e7b/attachment.html>