Displaying 1 result from an estimated 1 matches for "tcall_r".
Did you mean:
call_r
2011 Jul 19
1
Measuring and comparing .C and .Call overhead
...trix A
n <- 10 #number of columns in matrix A (= number of rows in vector x)
N <- 1000000
A <- runif(m*n)
x <- runif(n)
# measuring .Call
tCall_c <- 0.0
t1 <- proc.time()[3]
for (i in 1:N) {
tCall_c <- tCall_c + .Call("matvecMultiply", as.double(A), as.double(x))
}
tCall_R <- proc.time()[3] - t1
cat(".Call - Time measured in R: ", round(tCall_R,2), "sec\n")
cat(".Call - Time measured in C++: ", round(tCall_c,2), "sec\n")
cat(".Call - Implied overhead: ", round(tCall_R,2) - round(tCall_c,2), "sec
-> per ca...