<div dir="ltr"><div>Hi Kaspar and Dirk,</div><div><br></div>It is indeed cumulative. Previously (presumably when that gallery page was written) it was not cumulative, but Romain Francois changed the behavior of the step() function several years ago, in this commit: <a href="https://github.com/RcppCore/Rcpp/commit/e295b2b178de55291e63705966368404bb0ce5e1">https://github.com/RcppCore/Rcpp/commit/e295b2b178de55291e63705966368404bb0ce5e1</a>.<div><br></div><div>There is no indication or reasoning about changing the behavior, so it may be that making it cumulative was unintentional.</div><div><br></div><div>Jonathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 29, 2016 at 8:23 AM, 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 29 December 2016 at 14:55, Kaspar Märtens wrote:<br>
| Hi, <br>
|<br>
| Trying out the Rcpp Timer example from <a href="http://gallery.rcpp.org/articles/" rel="noreferrer" target="_blank">http://gallery.rcpp.org/<wbr>articles/</a><br>
| using-the-rcpp-timer/ I was unable to reproduce similar results. The example<br>
| output<br>
|<br>
|     get/put g/p+rnorm()  empty loop <br>
|   1.967e+03   3.288e+03   6.400e-04 <br>
|<br>
| compared to the output I see<br>
|<br>
|     get/put g/p+rnorm()  empty loop<br>
|    733.5265   1884.9589   1884.9601<br>
|<br>
| Suspiciously, the empty loop appears to take the longest. Could these be<br>
| cumulatively measured times here? <br>
<br>
</span>It is possibly that there is a thinko / bug / error somewhere.  I just re-ran<br>
it via sourceCpp() [ see below ] which is pretty much what Ruby + Jekyll do<br>
to build the Rcpp Gallery pages.<br>
<br>
The results will reflect the underlying machines a little but the difference<br>
you show is much starker.  What is your OS / compiler?   Ubuntu 16.04 with<br>
g++-5.3 here; page was original written with an older g++.<br>
<br>
Dirk<br>
<br>
<br>
Copy and paste below (and I just removed two lines pertaining to ESS which do<br>
no matter here).<br>
<br>
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"<br>
Copyright (C) 2016 The R Foundation for Statistical Computing<br>
Platform: x86_64-pc-linux-gnu (64-bit)<br>
<br>
R is free software and comes with ABSOLUTELY NO WARRANTY.<br>
You are welcome to redistribute it under certain conditions.<br>
Type 'license()' or 'licence()' for distribution details.<br>
<br>
  Natural language support but running in an English locale<br>
<br>
R is a collaborative project with many contributors.<br>
Type 'contributors()' for more information and<br>
'citation()' on how to cite R or R packages in publications.<br>
<br>
Type 'demo()' for some demos, 'help()' for on-line help, or<br>
'help.start()' for an HTML browser interface to help.<br>
Type 'q()' to quit R.<br>
<br>
R> library(Rcpp)<br>
R> sourceCpp("~/git/rcpp-gallery/<wbr>src/2013-01-06-using-the-rcpp-<wbr>timer.cpp")<br>
<br>
R> useTimer()<br>
    get/put g/p+rnorm()  empty loop<br>
    1620.67     3973.43     3973.44<br>
R><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
______________________________<wbr>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-<wbr>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/rcpp-devel</a><br>
</font></span></blockquote></div><br></div>