DataSlingers / MoMA

MoMA: Modern Multivariate Analysis in R
https://DataSlingers.github.io/MoMA
GNU General Public License v2.0
22 stars 4 forks source link

Skip RNG Set-Up #39

Open michaelweylandt opened 5 years ago

michaelweylandt commented 5 years ago

By default, Rcpp transfers the RNG state to and from R when calling into C++. This is a little bit expensive and not necessary for us since we don't use RNGs in C++.

If we change our C++ attributes to // [[Rcpp::export(rng = false)]], things will be a smidge faster. (I'd imagine this is still dwarfed by compute time, but it can't hurt.)

See example at https://github.com/tidyverse/dplyr/blob/e08f0511986a10efda5b9fd991af2e049d801333/src/address.cpp#L18