I was inspired by the fst package to try to write a C++ function to quickly serialize some data structures I have in R to disk.
In R, matrix multiplication is very optimized, i.e. is really just a call to BLAS/LAPACK. However, I'm surprised this very naive C++ code for matrix multiplication seems reliably 30% faster.
Notice the accepted answer pointed out the problem lies in reseeding. Reseeding is not the reason. Tests without reseeding also resulted in high correlations before posting. See Note1.
With RcppArmadillo the conversion from R to Rcpp with arma::vec is just as easy as with Rcpp and NumericVector. My project utilizes RcppArmadillo.