Skip to content

Instantly share code, notes, and snippets.

@imanuelcostigan
Created February 21, 2015 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imanuelcostigan/d6abf09286915a4ba51e to your computer and use it in GitHub Desktop.
Save imanuelcostigan/d6abf09286915a4ba51e to your computer and use it in GitHub Desktop.
RRO performance vs base R

Base R

library("microbenchmark")
x <- 1:10
y <- rnorm(10)
microbenchmark(R = approx(x, y, x+0.5))
#> Unit: microseconds
#> expr    min      lq     mean median    uq      max neval
#>    R 69.698 85.2985 173.4748 86.277 87.98 8411.178   100

RRO

library("microbenchmark")
x <- 1:10
y <- rnorm(10)
microbenchmark(RRO = approx(x, y, x+0.5))
#> Unit: microseconds
#> expr    min      lq     mean median      uq     max neval
#>  RRO 45.161 47.2345 66.59206 49.072 66.2125 916.439   100

Summary

RRO's use of multi-threaded linear algebra libraries makes interpolation approximately twice as fast (mean/median) and brings down worst performance significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment