On 27 August 2012 at 11:31, Peng Yu wrote:
| The following code shows that inline function is over 10 times faster
| than .Call and calling .Call directly is slower than call .Call by
| wrapping it in another function. Is this expected?

inlines uses .Call, so there is a slight logical problem here...  And yes,
functions have overheads.


| library(microbenchmark)
| microbenchmark(test(xx))
| microbenchmark(test_inline(xx))
| microbenchmark(.Call('test', xx))

The normal idiom is a _single_ call so that you can compare:

  microbenchmark(test(xx), test_inline(xx), .Call('test', xx))


Dirk

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com  
_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to