Is there a performance hit when using user-defined functions?


#1

Hi everyone,

I am just playing with GPs and decided to move the calculation of the Cholesky decomposition into a function. I was wondering whether there is ever a disadvantage of writing a user-defined Stan function in terms of efficiency – is there some data passing back and forth, or is there no disadvantage to using them?

Thanks in advance,
Martin


#2

The arguments are passed by reference, so no measureable difference.


#3

Good to know, thanks!