7 ## load shared libraries with wrapper code
8 dyn.load("overhead_1.so")
9 dyn.load("overhead_2.so")
11 overhead_c_symbol <- getNativeSymbolInfo( "overhead_c" )
12 overhead_cpp_symbol <- getNativeSymbolInfo( "overhead_cpp" )
14 overhead_c <- function(a,b) .Call( overhead_c_symbol, a, b )
15 overhead_cpp <- function(a,b) .Call( overhead_cpp_symbol, a, b )
17 ## load benchmarkin helper function
18 suppressMessages(library(rbenchmark))
20 res <- benchmark(overhead_cpp(a,b), overhead_c(a,b),
21 columns=c("test", "replications", "elapsed", "relative", "user.self", "sys.self"),