knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(LCpackage)
library(microbenchmark)
print_date()
add(3, 4)
add_cpp(3, 4)

Benchmark

microbenchmark(add(100, 1000), add_cpp(100, 1000))

The Rcpp code is much slower than the base R code!



StateOfTheR/LCpackage documentation built on April 19, 2020, 6:05 p.m.