[Rcpp-devel] R.e. First foray into Rcpp and comparison of speed with R

Dirk Eddelbuettel edd at debian.org
Sat Sep 3 06:48:20 CEST 2011


On 3 September 2011 at 10:54, Darren Cook wrote:
| Anyway, I extended Christian Gunning's example with a noNA version
| [1], then an STL version [2] that uses std::vector, then a C/C++ pointer
| version [3]. [4] shows my compiler options (all defaults).
| 
|         test replications elapsed relative user.self
|      bracket           50   5.151 1.001556      5.14
|  bracket_cpp           50   5.145 1.000389      5.13
| bracket_noNA           50   5.144 1.000194      5.14
|  bracket_stl           50   5.143 1.000000      5.14
|       parens           50  44.815 8.713786     44.80
| 
| 
| I upped the repetitions to 50 and shutdown a few apps on my computer
| during the test run to get better results. The stl version is

That is essentially within measurement error -- I'd declare the first four to
be in a tie.  And am still stunned that 'parens' is so much slower.

Thanks for aggregating this!

Dirk

-- 
Two new Rcpp master classes for R and C++ integration scheduled for 
New York (Sep 24) and San Francisco (Oct 8), more details are at
http://dirk.eddelbuettel.com/blog/2011/08/04#rcpp_classes_2011-09_and_2011-10
http://www.revolutionanalytics.com/products/training/public/rcpp-master-class.php


More information about the Rcpp-devel mailing list