Skip to content

Instantly share code, notes, and snippets.

@bobthecat
Created June 9, 2012 23:32
Show Gist options
  • Save bobthecat/2903039 to your computer and use it in GitHub Desktop.
Save bobthecat/2903039 to your computer and use it in GitHub Desktop.
Rcpp cosine speed comparison
library(rbenchmark)
res <- benchmark( cosine(mat),
cosineRcpp(mat),
columns=c("test", "replications", "elapsed",
"relative", "user.self", "sys.self"),
order="relative",
replications=1000)
res
test replications elapsed relative user.self sys.self
2 cosineRcpp(mat) 1000 149.974 1.000000 139.389 7.356
1 cosine(mat) 1000 161.268 1.075306 148.613 10.069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment