DataSlingers / ExclusiveLasso

Generalized Linear Models with the Exclusive Lasso Penalty
https://DataSlingers.github.io/ExclusiveLasso/
5 stars 2 forks source link

Skip RNG Set Up #14

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