Skip to content
Prev 41379 / 63421 Next

Increase transparency: suggestion on how to avoid namespaces and/or unnecessary overwrites of existing functions

On Oct 1, 2011, at 7:52 PM, Joshua Wiley wrote:

            
Depending on what you mean ;). If you mean that compiling code containing :: removes the issue, yes, that is indeed true (i.e., foo::bar gets compiled into the actual value since the compiler can assume that it is a constant and thus :: is not actually called).

If you mean that compiling base and thus :: then that helps only to a degree. According to microbenchmark the overhead of :: is in the order of 7.5ms when compiled and 11ms when not compiled on my test machine (Xeon X5690 and R-devel which is actually much faster than the 30ms in R 2.13.1). If the time spent in your actual function is in the order of  microseconds then the overhead is still huge in either case. If it's much bigger then either doesn't matter.

Cheers,
Simon